 |
ATLAS Offline Software
|
Go to the documentation of this file.
13 #ifndef CREST_COND_CONTAINER_H
14 #define CREST_COND_CONTAINER_H
19 #include "nlohmann/json.hpp"
28 const static std::map<TypeId, std::string> s_typeToString = {
char data[hepevt_bytes_allocation_ATLAS]
void setPayloadSpec(const nlohmann::json &j)
uint64_t getFirstTime()
It return minimal timestamp in concainer.
void addNullRecord(const std::string &name)
It adds a null value to the payload.
void addColumn(const std::string &name, TypeId type)
It adds a column to the payload specification.
void addRecord(const std::string &name, int number,...)
It adds a record to the payload.
std::vector< uint64_t > fromJson(uint64_t since, const nlohmann::json &j)
It reads a json object to fill the container.
nlohmann::json readJsonFromFile(const std::string &filename, const std::string &spec_filename)
It reads a json file and returns the json object.
const nlohmann::json & getIovData()
Return selected IOV in json format.
void setVectorPayload(bool isVectorPayload)
Set the Vectore mode of the container.
const nlohmann::json & getRow()
const nlohmann::json & getPayload()
Return current payload in json format.
bool isVectorPayload()
It sets the Vector mode of the container.
std::string getJsonPayload()
It returns the json representation of the container.
void flush()
It reinitializes the containers.
void setIovData(const nlohmann::json &j)
int getColumnIndex(const std::string &name)
It returns the index of the column with the given name.
nlohmann::json m_vector_data
nlohmann::json m_iov_data
std::vector< std::string > channelIds()
Return list of channel id in string format.
const std::vector< std::pair< std::string, TypeId > > & getMPayloadSpec()
Return tag specification in vector format.
std::map< uint64_t, nlohmann::json > m_full_data
void addExternalData(const std::string &channel_id, const nlohmann::json &data)
It associate the payload row to a channel_id.
void parseOldFormat(const std::string &colName, const TypeId &typespec, const nlohmann::json &j)
~CrestContainer()
Destructor of CrestContainer.
void dumpJsonToFile(const nlohmann::json &j, const std::string &filename)
It creates a file with the json representation of the container.
void clear()
It clear data the container.
nlohmann::json getStoreSetDto(uint64_t period=-1)
It return StoreSetDto in json format.
void addData(const std::string &channel_id)
It associate the payload row to a channel_id.
void parseData(const nlohmann::json &values)
It reads a json object, parse it and fill the container.
std::vector< uint64_t > readDcsFullType(const nlohmann::json &j_in)
nlohmann::json getPayloadSpec()
Return payload specification in json format.
It compares timestamp in string format.
CrestContainer(ModeId mode=ModeId::Standard)
Constructor of CrestContainer.
const nlohmann::json getPayloadChannel(const std::string &channel_id)
Return payload in json format for selected channel id.
void selectIov(const uint64_t since)
It select timestamp as active.
void setPayload(const nlohmann::json &j)
void readCommonType(uint64_t since, const nlohmann::json &j_in)
std::string getJsonIovData()
It returns the json representation of the container.
std::vector< std::pair< std::string, TypeId > > m_payload_spec
nlohmann::json createRowArray(const nlohmann::json &data_row) const
void addIov(const uint64_t since)
It adds an IOV to the json object m_iov_data.
void putRow2Vector()
It adds row data to vector.