runMACS
 All Data Structures Files Functions Variables Enumerations Enumerator Macros
FileStorageExtractor.h
Go to the documentation of this file.
1 #ifndef FILE_STORAGE_EXTRACTOR_H
2 #define FILE_STORAGE_EXTRACTOR_H
3 
4 #include <Extractor.h>
5 #include <StorageManager.h>
6 
7 #include <thread>
8 #include <mutex>
9 
11 public:
12  FileStorageExtractor(zmq::context_t & _ctx,
13  const PubSubEndpoint & _source,
14  const std::string & _identifier,
15  StorageManager & _storageManager,
16  int _maxFrames = -1,
17  const std::string & _metaData = "{}",
18  int _framesPerFileCycle = -1,
19  bool _cumulative = false,
20  bool _binning = false,
21  double _wantedFPS = 0);
23  std::string type();
24  std::string identifier();
25  std::list<std::string> parameters();
26 private:
27  void extractSetup();
28  void extractImpl(unsigned int _width,
29  unsigned int _height,
30  unsigned int _bytesPerPixel,
31  uint64_t highResTime,
32  uint64_t wallTime,
33  zmq::message_t * sourceImage);
34  void extractTeardown();
35 
36  void openFile();
37  void closeFile();
38 
39  std::string s_identifier;
40  StorageManager * storageManager;
41  char filename[256];
42  FILE* fil = nullptr;
43 
44  std::list<uint64_t> wallTimes;
45  std::list<uint64_t> highResTimes;
46  unsigned int width;
47  unsigned int height;
48  unsigned int bytesPerPixel;
49  int framesWritten;
50  int totalFramesWritten;
51  int maxFrames;
52  int framesPerFileCycle;
53  bool cumulative;
54  bool binning;
55  std::string metaData;
56  bool error;
57 
58  float * accLinear = nullptr;
59  float * accQuadratic = nullptr;
60  uint16_t * tmpdata = nullptr;
61 
62  std::thread * lastHeaderWriterThread = nullptr;
63  std::mutex lastHeaderWriterThreadMutex;
64 };
65 
66 #endif /* FILE_STORAGE_EXTRACTOR_H */
Base class for an image extractor.
Definition: Extractor.h:17
Handles storage locations.
FileStorageExtractor(zmq::context_t &_ctx, const PubSubEndpoint &_source, const std::string &_identifier, StorageManager &_storageManager, int _maxFrames=-1, const std::string &_metaData="{}", int _framesPerFileCycle=-1, bool _cumulative=false, bool _binning=false, double _wantedFPS=0)
std::list< std::string > parameters()