|
ATLAS Offline Software
|
Go to the documentation of this file.
13 #ifndef CREST_COND_CONTAINER_H
14 #define CREST_COND_CONTAINER_H
21 #include "nlohmann/json.hpp"
30 const static std::map<TypeId, std::string> s_typeToString = {
150 throw std::runtime_error(
"JSON exception for key: " +
name);
154 throw std::runtime_error(
"Column name not found or type mismatch.");
176 static std::vector<unsigned char>
base64_decode(
const std::string& encodedData);
Crest::TypeId stringToTypeId(const std::string &type) const
char data[hepevt_bytes_allocation_ATLAS]
void addData(const char *channel_id)
It associate the payload row to a channel_id.
void setPayloadSpec(const nlohmann::json &j)
void addColumn(const std::string &name, TypeId type)
It adds a column to the payload specification.
void parseOldFormat(std::string &colName, TypeId &typespec, const nlohmann::json &j)
nlohmann::json m_full_data
const nlohmann::json & getIovData()
void setVectorPayload(bool isVectorPayload)
const nlohmann::json & getRow()
T getRecord(const std::string &name)
const nlohmann::json & getPayload()
bool isVectorPayload()
It sets the mode of the container.
std::string getJsonPayload()
It returns the json representation of the container.
void flush()
It reinitializes the containers.
void dump_json_to_file(const nlohmann::json &j, const std::string &filename)
It creates a file with the json representation of the container.
static std::vector< unsigned char > base64_decode(const std::string &encodedData)
It decodes the input string from base64.
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()
const std::vector< std::pair< std::string, TypeId > > & getMPayloadSpec()
void addNullRecord(const char *name)
It adds a null value to the payload.
nlohmann::json read_json_from_file(const std::string &filename, const std::string &spec_filename)
It reads a json file and returns the json object.
static std::string base64_encode(const uint8_t *bytes_to_encode, unsigned int in_len)
It encodes the input string to base64.
Crest::TypeId intToTypeId(int value) const
nlohmann::json getPayloadSpec()
void addRecord(const char *name, int number,...)
It adds a record to the payload.
void from_json(const uint64_t since, const nlohmann::json &j)
It reads a json object to fill the containers.
void validatePayloadSize(const nlohmann::json &data) const
void addExternalData(const char *channel_id, const nlohmann::json &data)
It associate the payload row to a channel_id.
void selectIov(const uint64_t since)
void setPayload(const nlohmann::json &j)
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.
const nlohmann::json & getPayloadChannel(const char *channel_id)
void putRow2Vector()
It adds row data to vector.