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

The TagDto class It contains all fields of the TagDto class from the CREST API. More...

#include <CrestModel.h>

Collaboration diagram for TagDto:

Public Member Functions

 TagDto (std::string _name, std::string _timeType, std::string _description)
 
 TagDto ()
 
json to_json () const
 

Static Public Member Functions

static TagDto from_json (const json &j)
 

Public Attributes

std::string name
 
std::string timeType
 
std::string objectType
 
std::string synchronization
 
std::string description
 
uint64_t lastValidatedTime
 
uint64_t endOfValidity
 
std::optional< std::string > insertionTime
 
std::optional< std::string > modificationTime
 

Detailed Description

The TagDto class It contains all fields of the TagDto class from the CREST API.

When using this to create a new Tag you don't need to set insertion and modification times.

Definition at line 97 of file CrestModel.h.

Constructor & Destructor Documentation

◆ TagDto() [1/2]

TagDto::TagDto ( std::string  _name,
std::string  _timeType,
std::string  _description 
)
inline

Definition at line 110 of file CrestModel.h.

110  : name(_name), timeType(_timeType),
111  objectType(""),
112  synchronization("none"),
113  description(_description),
115 
116  }

◆ TagDto() [2/2]

TagDto::TagDto ( )
inline

Definition at line 118 of file CrestModel.h.

118  : name(""), timeType(""), objectType(""), synchronization("none"), description(""), lastValidatedTime(0), endOfValidity(0) {
119 
120  }

Member Function Documentation

◆ from_json()

TagDto TagDto::from_json ( const json j)
static

Definition at line 188 of file CrestModel.cxx.

189 {
190  TagDto tag;
191  auto it = j.find("name");
192  if (it != j.end())
193  {
194  tag.name = j["name"];
195  }
196  else
197  {
198  throw Crest::CrestException("ERROR in TagDto.from_json: JSON contains no tag name.");
199  }
200 
201  tag.timeType = j.value("timeType", "");
202  tag.objectType = j.value("payloadSpec", "");
203  tag.synchronization = j.value("synchronization", "none");
204  tag.description = j.value("description", "");
205  tag.lastValidatedTime = j.value<uint64_t>("lastValidatedTime", 0);
206  tag.endOfValidity = j.value<uint64_t>("endOfValidity", 0);
207  if (j.contains(std::string{"insertionTime"}))
208  tag.insertionTime = j.value("insertionTime", "");
209  tag.modificationTime = j.value("modificationTime", "");
210  return tag;
211 }

◆ to_json()

json TagDto::to_json ( ) const

Definition at line 172 of file CrestModel.cxx.

173 {
174  json js = {};
175  js["name"] = name;
176  js["timeType"] = timeType;
177  js["payloadSpec"] = objectType;
178  js["synchronization"] = synchronization;
179  if (insertionTime.has_value())
180  js["insertionTime"] = insertionTime.value();
181  js["description"] = description;
182  js["lastValidatedTime"] = lastValidatedTime;
183  js["endOfValidity"] = endOfValidity;
184  if (modificationTime.has_value())
185  js["modificationTime"] = modificationTime.value();
186  return js;
187 }

Member Data Documentation

◆ description

std::string TagDto::description

Definition at line 104 of file CrestModel.h.

◆ endOfValidity

uint64_t TagDto::endOfValidity

Definition at line 106 of file CrestModel.h.

◆ insertionTime

std::optional<std::string> TagDto::insertionTime

Definition at line 107 of file CrestModel.h.

◆ lastValidatedTime

uint64_t TagDto::lastValidatedTime

Definition at line 105 of file CrestModel.h.

◆ modificationTime

std::optional<std::string> TagDto::modificationTime

Definition at line 108 of file CrestModel.h.

◆ name

std::string TagDto::name

Definition at line 100 of file CrestModel.h.

◆ objectType

std::string TagDto::objectType

Definition at line 102 of file CrestModel.h.

◆ synchronization

std::string TagDto::synchronization

Definition at line 103 of file CrestModel.h.

◆ timeType

std::string TagDto::timeType

Definition at line 101 of file CrestModel.h.


The documentation for this class was generated from the following files:
TagDto::description
std::string description
Definition: CrestModel.h:104
TagDto::timeType
std::string timeType
Definition: CrestModel.h:101
json
nlohmann::json json
Definition: HistogramDef.cxx:9
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TagDto::name
std::string name
Definition: CrestModel.h:100
TagDto::insertionTime
std::optional< std::string > insertionTime
Definition: CrestModel.h:107
TagDto
The TagDto class It contains all fields of the TagDto class from the CREST API.
Definition: CrestModel.h:98
TagDto::modificationTime
std::optional< std::string > modificationTime
Definition: CrestModel.h:108
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
TagDto::lastValidatedTime
uint64_t lastValidatedTime
Definition: CrestModel.h:105
TagDto::endOfValidity
uint64_t endOfValidity
Definition: CrestModel.h:106
TagDto::objectType
std::string objectType
Definition: CrestModel.h:102
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
Crest::CrestException
Definition: CrestException.h:9
TagDto::synchronization
std::string synchronization
Definition: CrestModel.h:103