ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Public Attributes | Private Attributes | List of all members
StoreDto Class Reference

#include <CrestModel.h>

Collaboration diagram for StoreDto:

Public Member Functions

 StoreDto (uint64_t l_since, const std::string &l_data)
 
 StoreDto (uint64_t since, const std::string &hash, const std::string &data)
 
 StoreDto ()
 
void setAppVersion (const char *str)
 
void setAppName (const char *str)
 
json getStreamerInfo () const
 
json to_json () const
 

Static Public Member Functions

static StoreDto from_json (const json &j)
 

Public Attributes

uint64_t since
 
std::string hash
 
std::string data
 
std::optional< std::string > insertionTime
 

Private Attributes

std::optional< std::string > m_app_name
 
std::optional< std::string > m_app_version
 

Detailed Description

Definition at line 300 of file CrestModel.h.

Constructor & Destructor Documentation

◆ StoreDto() [1/3]

StoreDto::StoreDto ( uint64_t  l_since,
const std::string &  l_data 
)
inline

Definition at line 309 of file CrestModel.h.

309  :
310  since(l_since), hash(""), data(l_data){
311 
312  }

◆ StoreDto() [2/3]

StoreDto::StoreDto ( uint64_t  since,
const std::string &  hash,
const std::string &  data 
)
inline

Definition at line 314 of file CrestModel.h.

314  :
315  since(since), hash(hash), data(data){
316 
317  }

◆ StoreDto() [3/3]

StoreDto::StoreDto ( )
inline

Definition at line 319 of file CrestModel.h.

319  : since(0), hash(""), data(""){
320  }

Member Function Documentation

◆ from_json()

StoreDto StoreDto::from_json ( const json j)
static

Definition at line 566 of file CrestModel.cxx.

567 {
568  StoreDto storeDto;
569  storeDto.hash = j.value("hash", "");
570  storeDto.since = j.value("since", 0.0);
571  storeDto.data = j.value("data", "");
572  //do we need get streamerInfo?
573  return storeDto;
574 }

◆ getStreamerInfo()

json StoreDto::getStreamerInfo ( ) const

Definition at line 556 of file CrestModel.cxx.

557 {
558  json js = {};
559  if (m_app_version.has_value())
560  js["app_version"] = m_app_version.value();
561  if (m_app_name.has_value())
562  js["app_name"] = m_app_name.value();
563  return js;
564 }

◆ setAppName()

void StoreDto::setAppName ( const char *  str)
inline

Definition at line 323 of file CrestModel.h.

323 {m_app_name=str;}

◆ setAppVersion()

void StoreDto::setAppVersion ( const char *  str)
inline

Definition at line 322 of file CrestModel.h.

◆ to_json()

json StoreDto::to_json ( ) const

Definition at line 547 of file CrestModel.cxx.

548 {
549  json dto = {};
550  dto["hash"] = hash;
551  dto["since"] = since;
552  dto["data"] = data;
553  dto["streamerInfo"] = getStreamerInfo().dump();
554  return dto;
555 }

Member Data Documentation

◆ data

std::string StoreDto::data

Definition at line 307 of file CrestModel.h.

◆ hash

std::string StoreDto::hash

Definition at line 306 of file CrestModel.h.

◆ insertionTime

std::optional<std::string> StoreDto::insertionTime

Definition at line 308 of file CrestModel.h.

◆ m_app_name

std::optional<std::string> StoreDto::m_app_name
private

Definition at line 302 of file CrestModel.h.

◆ m_app_version

std::optional<std::string> StoreDto::m_app_version
private

Definition at line 303 of file CrestModel.h.

◆ since

uint64_t StoreDto::since

Definition at line 305 of file CrestModel.h.


The documentation for this class was generated from the following files:
StoreDto
Definition: CrestModel.h:301
StoreDto::m_app_name
std::optional< std::string > m_app_name
Definition: CrestModel.h:302
StoreDto::since
uint64_t since
Definition: CrestModel.h:305
json
nlohmann::json json
Definition: HistogramDef.cxx:9
StoreDto::hash
std::string hash
Definition: CrestModel.h:306
StoreDto::m_app_version
std::optional< std::string > m_app_version
Definition: CrestModel.h:303
StoreDto::data
std::string data
Definition: CrestModel.h:307
StoreDto::getStreamerInfo
json getStreamerInfo() const
Definition: CrestModel.cxx:556
python.CaloScaleNoiseConfig.str
str
Definition: CaloScaleNoiseConfig.py:78