Newer
Older
/*
* PacketLib.h
*
* Created on: Nov 24, 2022
* Author: valerio
*/
#ifndef INCLUDE_INAF_OAS_PACKET_STRUCTURE_JSON_H_
#define INCLUDE_INAF_OAS_PACKET_STRUCTURE_JSON_H_
#include <Base_Packet.h>
#include <fstream>
using namespace nlohmann;
// A workaround to give to use fifo_map as map, we are just ignoring the 'less' compare
template<class K, class V, class dummy_compare, class A>
using my_workaround_fifo_map = fifo_map<K, V, fifo_map_compare<K>, A>;
using my_json = basic_json<my_workaround_fifo_map>;
namespace inaf::oasbo::Packets {
class PacketStructureJson : public inaf::oasbo::PacketLib::BasePacketStructure {
std::vector<std::tuple<uint, std::string, uint>> convertToTupleVector(const my_json &data,
std::vector<std::tuple<uint, std::string, uint>> readStructureFromSource(
PacketStructureJson(std::string source) : BasePacketStructure(source){
updateStructure(this->source);
}
PacketStructureJson(const BasePacketStructure &other) : BasePacketStructure(other){
};
}
#endif /* INCLUDE_INAF_OAS_PACKET_STRUCTURE_JSON_H_ */