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
8 //#define DEBUG_DUMP_TO_CONSOLE_ENABLED
9 
11 {
12 public:
13  static DataDumper& instance()
14  {
15  static DataDumper _instance;
16  return _instance;
17  }
19  int pushData(double timeStamp, std::string info, double val);
20  int writeDataToCsv(std::string fileName);
22 
23  int dumpUcharBufferToConsole(unsigned char *buffer, int bufLen);
24  int testbed();
25 private:
26  const int maxFifoSize = 10000;
27  std::vector<double> timeStampVec;
28  std::vector<std::string> infoVec;
29  std::vector<double> dataVec;
32  {
33  timeStampVec.resize(maxFifoSize);
34  infoVec.resize(maxFifoSize);
35  dataVec.resize(maxFifoSize);
36  pushCounter = 0;
37  } // verhindert, dass ein Objekt von au�erhalb von N erzeugt wird.
38  // protected, wenn man von der Klasse noch erben m�chte
39  DataDumper(const DataDumper&); /* verhindert, dass eine weitere Instanz via
40  Kopier-Konstruktor erstellt werden kann */
41  DataDumper & operator = (const DataDumper &); //Verhindert weitere Instanz durch Kopie
42  std::string dumpFileName;
43 };
44 
45 /* Verwendung:
46 DataDumper& s = DataDumper::instance();
47 s.xyz();
48 //oder
49 DataDumper::instance().xyz(); */
50 #endif
filename
int testbed()
Definition: dataDumper.cpp:99
int pushData(double timeStamp, std::string info, double val)
Definition: dataDumper.cpp:11
std::vector< std::string > infoVec
Definition: dataDumper.h:28
std::string dumpFileName
Definition: dataDumper.h:42
int writeDataToCsv(std::string fileName)
Definition: dataDumper.cpp:37
int pushCounter
Definition: dataDumper.h:30
int writeToFileNameWhenBufferIsFull(std::string filename)
Definition: dataDumper.cpp:59
static DataDumper & instance()
Definition: dataDumper.h:13
std::vector< double > timeStampVec
Definition: dataDumper.h:27
const int maxFifoSize
Definition: dataDumper.h:26
std::vector< double > dataVec
Definition: dataDumper.h:29
int dumpUcharBufferToConsole(unsigned char *buffer, int bufLen)
Definition: dataDumper.cpp:65
DataDumper & operator=(const DataDumper &)


sick_scan
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Tue Jul 9 2019 04:55:32