DeviceLogSorted.h
Go to the documentation of this file.
1 /*
2 MIT LICENSE
3 
4 Copyright (c) 2014-2020 Inertial Sense, Inc. - http://inertialsense.com
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
7 
8 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9 
10 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11 */
12 
13 #ifndef DEVICE_LOG_SORTED_H
14 #define DEVICE_LOG_SORTED_H
15 
16 #include <stdio.h>
17 #include <string>
18 #include <vector>
19 #include <list>
20 
21 #include "DeviceLog.h"
22 #include "DataChunkSorted.h"
23 
24 using namespace std;
25 
27 {
28 public:
30 
31  void InitDeviceForWriting(int pHandle, std::string timestamp, std::string directory, uint64_t maxDiskSpace, uint32_t maxFileSize) OVERRIDE;
32  void InitDeviceForReading() OVERRIDE;
33  bool CloseAllFiles() OVERRIDE;
34  bool SaveData(p_data_hdr_t* dataHdr, const uint8_t* dataBuf) OVERRIDE;
35  p_data_t* ReadData() OVERRIDE;
36  void SetSerialNumber(uint32_t serialNumber) OVERRIDE;
37  string LogFileExtention() OVERRIDE { return string(".sdat"); }
38 
40 
41  p_data_t* SerializeDataFromChunks();
42  bool ReadAllChunksFromFile();
43  bool ReadChunkFromFile(cSortedDataChunk *chunk);
44 
45  uint32_t m_dataSerNum;
46  uint32_t m_lastSerNum;
49 };
50 
51 #endif // DEVICE_LOG_SORTED_H
#define OVERRIDE
Definition: ISConstants.h:423
GeneratorWrapper< std::vector< T > > chunk(size_t size, GeneratorWrapper< T > &&generator)
Definition: catch.hpp:3900
#define DID_COUNT
Definition: data_sets.h:138
cSortedDataChunk m_readChunk
string LogFileExtention() OVERRIDE


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