dataDumper.h
Go to the documentation of this file.
1 #ifndef DATA_DUMPER_H
2 #define DATA_DUMPER_H
3 
4 #include <string>
5 #include <vector>
6 
7 #define DEBUG_DUMP_ENABLED 0
8 //#define DEBUG_DUMP_TO_CONSOLE_ENABLED
9 
11 {
12 public:
13  static DataDumper &instance()
14  {
15  static DataDumper _instance;
16  return _instance;
17  }
18 
20  {}
21 
22  int pushData(double timeStamp, std::string info, double val);
23 
24  int writeDataToCsv(std::string fileName);
25 
27 
28  int dumpUcharBufferToConsole(unsigned char *buffer, int bufLen);
29 
35  static std::string binDataToAsciiString(const uint8_t* binary_data, int length);
36 
37  int testbed();
38 
39 private:
40  const int maxFifoSize = 10000;
41  std::vector<double> timeStampVec;
42  std::vector<std::string> infoVec;
43  std::vector<double> dataVec;
45 
47  {
48  timeStampVec.resize(maxFifoSize);
49  infoVec.resize(maxFifoSize);
50  dataVec.resize(maxFifoSize);
51  pushCounter = 0;
52  } // verhindert, dass ein Objekt von au�erhalb von N erzeugt wird.
53  // protected, wenn man von der Klasse noch erben m�chte
54  DataDumper(const DataDumper &); /* verhindert, dass eine weitere Instanz via
55  Kopier-Konstruktor erstellt werden kann */
56  DataDumper &operator=(const DataDumper &); //Verhindert weitere Instanz durch Kopie
57  std::string dumpFileName;
58 };
59 
60 /* Verwendung:
61 DataDumper& s = DataDumper::instance();
62 s.xyz();
63 //oder
64 DataDumper::instance().xyz(); */
65 #endif
filename
int testbed()
Definition: dataDumper.cpp:127
static std::string binDataToAsciiString(const uint8_t *binary_data, int length)
Definition: dataDumper.cpp:108
int pushData(double timeStamp, std::string info, double val)
Definition: dataDumper.cpp:13
std::vector< std::string > infoVec
Definition: dataDumper.h:42
std::string dumpFileName
Definition: dataDumper.h:57
int writeDataToCsv(std::string fileName)
Definition: dataDumper.cpp:39
int pushCounter
Definition: dataDumper.h:44
int writeToFileNameWhenBufferIsFull(std::string filename)
Definition: dataDumper.cpp:61
static DataDumper & instance()
Definition: dataDumper.h:13
std::vector< double > timeStampVec
Definition: dataDumper.h:41
const int maxFifoSize
Definition: dataDumper.h:40
std::vector< double > dataVec
Definition: dataDumper.h:43
TFSIMD_FORCE_INLINE tfScalar length(const Quaternion &q)
int dumpUcharBufferToConsole(unsigned char *buffer, int bufLen)
Definition: dataDumper.cpp:67
DataDumper & operator=(const DataDumper &)


sick_scan
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Wed May 5 2021 03:05:47