ISCommDataBuffer.h
Go to the documentation of this file.
1 #ifndef CCOMDATABUFFER_H
2 #define CCOMDATABUFFER_H
3 
4 #include <vector>
5 #include <inttypes.h>
6 #include "com_manager.h"
7 #include "ISUtilities.h"
8 
9 using namespace std;
10 
12 {
13 public:
15  virtual ~cComDataBuffer();
16 
17  // add data to the data buffer for the pHandle using the data id in data, return 0 if success, otherwise error code
18  int PushData(int pHandle, const p_data_t* data);
19 
20  // reads the entire data for a pHandle and data id into a vector of bytes - data will be cleared first, return 0 if success, otherwise error code
21  int ReadData(int pHandle, uint32_t dataId, vector<uint8_t>& data);
22 
23  // clear all data from memory and remove all temp files
24  void Reset();
25 
26 private:
27  typedef struct
28  {
29  FILE* file;
31  string path;
32  } buffer_file_t;
33 
34  void EnsureBuffers(int pHandle);
35 
36  // for each pHandle, a vector for each data id containing a file of the raw data
37  vector<vector<buffer_file_t>> m_buffers;
38 
39  // for each pHandle, a vector for each data id containing the a file with the timestamp for that data
40  vector<vector<buffer_file_t>> m_timestamps;
41 
43  cMutex m_mutex;
44  string basePath;
45 
46 };
47 
49 
50 #endif // CCOMDATABUFFER_H
vector< vector< buffer_file_t > > m_timestamps
cComDataBuffer g_comDataBuffer
vector< vector< buffer_file_t > > m_buffers
USBInterfaceDescriptor data


inertial_sense_ros
Author(s):
autogenerated on Sat Sep 19 2020 03:19:04