6 #ifndef DYNAMIC_GRAPH_TRACER_H 7 #define DYNAMIC_GRAPH_TRACER_H 8 #include <boost/function.hpp> 12 #include <dynamic-graph/entity.h> 13 #include <dynamic-graph/exception-traces.h> 14 #include <dynamic-graph/signal-base.h> 15 #include <dynamic-graph/signal-time-dependent.h> 16 #include <dynamic-graph/time-dependency.h> 18 #include <dynamic-graph/config-tracer.hh> 25 DYNAMIC_GRAPH_ENTITY_DECL();
28 typedef std::list<const SignalBase<int> *> SignalList;
29 SignalList toTraceSignals;
43 static const TraceStyle TRACE_STYLE_DEFAULT = EACH_TIME;
50 typedef std::list<std::ostream *> FileList;
52 typedef std::list<std::string> NameList;
58 Tracer(
const std::string n);
59 virtual ~
Tracer() { closeFiles(); }
62 const std::string &filename =
"");
63 void addSignalToTraceByName(
const std::string &signame,
64 const std::string &filename =
"");
65 void clearSignalToTrace();
67 void openFiles(
const std::string &rootdir,
const std::string &basename,
68 const std::string &suffix);
69 virtual void closeFiles();
73 const std::string &filename);
76 void setTraceStyle(
const TraceStyle &style) { traceStyle = style; }
77 TraceStyle getTraceStyle() {
return traceStyle; }
79 void setFrenquency(
const double &frqu) { frequency = frqu; }
80 double getFrequency() {
return frequency; }
83 virtual void recordSignal(std::ostream &os,
const SignalBase<int> &sig);
84 int &recordTrigger(
int &dummy,
const int &time);
87 void start() { play =
true; }
88 void stop() { play =
false; }
95 DG_TRACER_DLLAPI
friend std::ostream &operator<<(std::ostream &os,
99 void display(std::ostream &os)
const;
This class represents an entity, i.e. a generic computational unit that provides input and output sig...
Tracer plug-in main class.