Add metadata buffer class

This commit is contained in:
2018-11-19 16:33:02 +01:00
parent 393919aca5
commit 1acd36f77f
2 changed files with 62 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
#ifndef METADATABUFFER_H
#define METADATABUFFER_H
#include <unordered_map>
#include <string>
#include "ZmqReceiver.hpp"
class MetadataBuffer
{
const uint64_t n_images;
const std::shared_ptr<std::unordered_map<std::string, HeaderDataType>> header_values_type;
protected:
std::unordered_map<std::string, std::shared_ptr<char>> metadata_buffer;
std::unordered_map<std::string, size_t> metadata_length_bytes;
public:
MetadataBuffer(uint64_t n_images, std::shared_ptr<std::unordered_map<std::string, HeaderDataType>> header_values_type);
void add_metadata_to_buffer(std::string name, uint64_t frame_index, const char* data);
std::shared_ptr<char> get_metadata_values(std::string name);
};
#endif