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

#include <CrestModel.h>

Inheritance diagram for GlobalTagMapSetDto:
Collaboration diagram for GlobalTagMapSetDto:

Public Member Functions

const char * getFormat () const
 
int64_t getSize () const
 
json to_json () const
 
void load_from_json (const json &j)
 

Static Public Member Functions

static GlobalTagMapSetDto from_json (const json &j)
 
static GlobalTagMapSetDto from_fs_json (const json &j)
 

Public Attributes

std::vector< GlobalTagMapDtoresources
 
std::optional< std::string > datatype
 
std::optional< RespPagepage
 
std::optional< GenericMapfilter
 

Detailed Description

Definition at line 159 of file CrestModel.h.

Member Function Documentation

◆ from_fs_json()

GlobalTagMapSetDto GlobalTagMapSetDto::from_fs_json ( const json j)
static

Definition at line 277 of file CrestModel.cxx.

278 {
279  GlobalTagMapSetDto tagMapSet;
280  tagMapSet.load_from_json(j);
281  // int n = j.size();
282 
283  for (auto it = j.begin(); it != j.end(); ++it)
284  {
285  tagMapSet.resources.push_back(GlobalTagMapDto::from_json(*it));
286  }
287 
288  tagMapSet.datatype = "maps";
289 
290  return tagMapSet;
291 }

◆ from_json()

GlobalTagMapSetDto GlobalTagMapSetDto::from_json ( const json j)
static

Definition at line 264 of file CrestModel.cxx.

265 {
266  GlobalTagMapSetDto tagMapSet;
267  tagMapSet.load_from_json(j);
268  json jsonResources = j.value("resources", json::array());
269  for (auto it = jsonResources.begin(); it != jsonResources.end(); ++it)
270  {
271  tagMapSet.resources.push_back(GlobalTagMapDto::from_json(*it));
272  }
273 
274  return tagMapSet;
275 }

◆ getFormat()

const char* GlobalTagMapSetDto::getFormat ( ) const
inlinevirtual

Implements CrestBaseResponse.

Definition at line 163 of file CrestModel.h.

163 {return "GlobalTagMapSetDto";}

◆ getSize()

int64_t GlobalTagMapSetDto::getSize ( ) const
inlinevirtual

Implements CrestBaseResponse.

Definition at line 164 of file CrestModel.h.

164 {return resources.size();}

◆ load_from_json()

void CrestBaseResponse::load_from_json ( const json j)
inherited

Definition at line 85 of file CrestModel.cxx.

86 {
87  if (j.contains("datatype"))
88  datatype = j.value("datatype", "");
89  // Check for the presence of "page" key and create an optional
90  if (j.contains("page"))
91  {
92  if (!j["page"].is_null())
93  {
94  page = std::make_optional((RespPage::from_json(j["page"])));
95  }
96  }
97 
98  // Check for the presence of "filter" key and create an optional
99  filter = j.contains("filter") ? std::make_optional(GenericMap::from_json(j["filter"])) : std::nullopt;
100 }

◆ to_json()

json GlobalTagMapSetDto::to_json ( ) const

Definition at line 253 of file CrestModel.cxx.

254 {
255  json baseJson = CrestBaseResponse::to_json();
256  json jsonResources = json::array();
257  for (const auto &resource : resources)
258  {
259  jsonResources.push_back(((GlobalTagMapDto)resource).to_json());
260  }
261  baseJson["resources"] = jsonResources;
262  return baseJson;
263 }

Member Data Documentation

◆ datatype

std::optional<std::string> CrestBaseResponse::datatype
inherited

Definition at line 45 of file CrestModel.h.

◆ filter

std::optional<GenericMap> CrestBaseResponse::filter
inherited

Definition at line 47 of file CrestModel.h.

◆ page

std::optional<RespPage> CrestBaseResponse::page
inherited

Definition at line 46 of file CrestModel.h.

◆ resources

std::vector<GlobalTagMapDto> GlobalTagMapSetDto::resources

Definition at line 162 of file CrestModel.h.


The documentation for this class was generated from the following files:
RespPage::from_json
static RespPage from_json(const json &j)
Definition: CrestModel.cxx:20
json
nlohmann::json json
Definition: HistogramDef.cxx:9
CrestBaseResponse::load_from_json
void load_from_json(const json &j)
Definition: CrestModel.cxx:85
GlobalTagMapDto::from_json
static GlobalTagMapDto from_json(const json &j)
Definition: CrestModel.cxx:243
skel.it
it
Definition: skel.GENtoEVGEN.py:396
GlobalTagMapSetDto::resources
std::vector< GlobalTagMapDto > resources
Definition: CrestModel.h:162
CrestBaseResponse::filter
std::optional< GenericMap > filter
Definition: CrestModel.h:47
GlobalTagMapSetDto
Definition: CrestModel.h:160
CrestBaseResponse::datatype
std::optional< std::string > datatype
Definition: CrestModel.h:45
GlobalTagMapSetDto::to_json
json to_json() const
Definition: CrestModel.cxx:253
lumiFormat.array
array
Definition: lumiFormat.py:91
CrestBaseResponse::page
std::optional< RespPage > page
Definition: CrestModel.h:46
CrestBaseResponse::to_json
json to_json() const
Definition: CrestModel.cxx:54
GlobalTagMapDto
Definition: CrestModel.h:139
GenericMap::from_json
static GenericMap from_json(const json &j)
Definition: CrestModel.cxx:41