tracer-real-time.h
Go to the documentation of this file.
1 // -*- mode: c++ -*-
2 // Copyright 2010, François Bleibel, Thomas Moulard, Olivier Stasse,
3 // JRL, CNRS/AIST.
4 //
5 
6 #ifndef DYNAMIC_GRAPH_TRACER_REAL_TIME_H
7 #define DYNAMIC_GRAPH_TRACER_REAL_TIME_H
8 #include <dynamic-graph/tracer.h>
9 
10 #include <dynamic-graph/config-tracer-real-time.hh>
11 #include <dynamic-graph/fwd.hh>
12 #include <sstream>
13 
14 namespace dynamicgraph {
18 class DG_TRACERREALTIME_DLLAPI OutStringStream : public std::ostringstream {
19  public:
20  char *buffer;
21  std::streamsize index;
22  std::streamsize bufferSize;
23  bool full;
24  std::string givenname;
25 
26  public:
28  ~OutStringStream();
29 
30  void resize(const std::streamsize &size);
31  bool addData(const char *data, const std::streamoff &size);
32  void dump(std::ostream &os);
33  void empty();
34 };
35 
39 class DG_TRACERREALTIME_DLLAPI TracerRealTime : public Tracer {
41 
42  public:
43  TracerRealTime(const std::string &n);
44  virtual ~TracerRealTime() {}
45 
46  virtual void closeFiles();
47  virtual void trace();
48 
49  void display(std::ostream &os) const;
50  DG_TRACERREALTIME_DLLAPI friend std::ostream &operator<<(
51  std::ostream &os, const TracerRealTime &t);
52 
53  void emptyBuffers();
54 
55  void setBufferSize(const int &SIZE) { bufferSize = SIZE; }
56 
57  const int &getBufferSize() { return bufferSize; }
58 
59  protected:
60  virtual void openFile(const SignalBase<int> &sig,
61  const std::string &filename);
62 
63  virtual void recordSignal(std::ostream &os, const SignalBase<int> &sig);
64 
65  typedef std::list<std::ofstream *> HardFileList;
66  static const int BUFFER_SIZE_DEFAULT = 1048576; // 1Mo
67 
69  HardFileList hardFiles;
70 };
71 } // end of namespace dynamicgraph
72 
73 #endif
std::list< std::ofstream * > HardFileList
Stream for the tracer real-time.
data
Definition: setup.in.py:48
dynamicgraph::SignalArray_const< double > sig
Definition: signal-all.cpp:25
Main class of the tracer real-time plug-in.
DYNAMIC_GRAPH_DLLAPI std::ostream & operator<<(std::ostream &os, const dynamicgraph::Entity &ent)
#define DYNAMIC_GRAPH_ENTITY_DECL()
Helper macro for entity declaration.
Tracer plug-in main class.
Definition: tracer.h:24
void setBufferSize(const int &SIZE)


dynamic-graph
Author(s): Nicolas Mansard, Olivier Stasse
autogenerated on Sun Jun 25 2023 02:06:03