6 #ifndef DYNAMIC_GRAPH_TRACER_H
7 #define DYNAMIC_GRAPH_TRACER_H
8 #include <dynamic-graph/entity.h>
9 #include <dynamic-graph/exception-traces.h>
10 #include <dynamic-graph/signal-base.h>
11 #include <dynamic-graph/signal-time-dependent.h>
12 #include <dynamic-graph/time-dependency.h>
14 #include <boost/function.hpp>
15 #include <dynamic-graph/config-tracer.hh>
25 DYNAMIC_GRAPH_ENTITY_DECL();
28 typedef std::list<const SignalBase<int> *> SignalList;
29 SignalList toTraceSignals;
43 TraceStyle traceStyle;
44 static const TraceStyle TRACE_STYLE_DEFAULT = EACH_TIME;
51 typedef std::list<std::ostream *> FileList;
53 typedef std::list<std::string> NameList;
59 Tracer(
const std::string n);
60 virtual ~
Tracer() { closeFiles(); }
62 void addSignalToTrace(
const SignalBase<int> &sig,
63 const std::string &filename =
"");
64 void addSignalToTraceByName(
const std::string &signame,
65 const std::string &filename =
"");
66 void clearSignalToTrace();
68 void openFiles(
const std::string &rootdir,
const std::string &basename,
69 const std::string &suffix);
70 virtual void closeFiles();
73 virtual void openFile(
const SignalBase<int> &sig,
74 const std::string &filename);
77 void setTraceStyle(
const TraceStyle &style) { traceStyle = style; }
78 TraceStyle getTraceStyle() {
return traceStyle; }
80 void setFrenquency(
const double &frqu) { frequency = frqu; }
81 double getFrequency() {
return frequency; }
84 virtual void recordSignal(std::ostream &os,
const SignalBase<int> &sig);
85 int &recordTrigger(
int &dummy,
const int &time);
88 void start() { play =
true; }
89 void stop() { play =
false; }
93 SignalTimeDependent<int, int> triger;
96 DG_TRACER_DLLAPI
friend std::ostream &operator<<(std::ostream &os,
100 void display(std::ostream &os)
const;