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

#include <CrestModel.h>

Inheritance diagram for TagMetaSetDto:
Collaboration diagram for TagMetaSetDto:

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 TagMetaSetDto from_json (const json &j)
 

Public Attributes

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

Detailed Description

Definition at line 256 of file CrestModel.h.

Member Function Documentation

◆ from_json()

TagMetaSetDto TagMetaSetDto::from_json ( const json j)
static

Definition at line 432 of file CrestModel.cxx.

433 {
434  TagMetaSetDto tagSet;
435  tagSet.load_from_json(j);
436  json jsonResources = j.value("resources", json::array());
437  for (auto it = jsonResources.begin(); it != jsonResources.end(); ++it)
438  {
439  tagSet.resources.push_back(TagMetaDto::from_json(*it));
440  }
441 
442  return tagSet;
443 }

◆ getFormat()

const char* TagMetaSetDto::getFormat ( ) const
inlinevirtual

Implements CrestBaseResponse.

Definition at line 260 of file CrestModel.h.

260 {return "TagMetaSetDto";}

◆ getSize()

int64_t TagMetaSetDto::getSize ( ) const
inlinevirtual

Implements CrestBaseResponse.

Definition at line 261 of file CrestModel.h.

261 {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 TagMetaSetDto::to_json ( ) const

Definition at line 421 of file CrestModel.cxx.

422 {
423  json baseJson = CrestBaseResponse::to_json();
424  json jsonResources = json::array();
425  for (const auto &resource : resources)
426  {
427  jsonResources.push_back(((TagMetaDto)resource).to_json());
428  }
429  baseJson["resources"] = jsonResources;
430  return baseJson;
431 }

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<TagMetaDto> TagMetaSetDto::resources

Definition at line 259 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
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TagMetaDto
Definition: CrestModel.h:238
CrestBaseResponse::filter
std::optional< GenericMap > filter
Definition: CrestModel.h:47
TagMetaSetDto
Definition: CrestModel.h:257
CrestBaseResponse::datatype
std::optional< std::string > datatype
Definition: CrestModel.h:45
lumiFormat.array
array
Definition: lumiFormat.py:91
TagMetaDto::from_json
static TagMetaDto from_json(const json &j)
Definition: CrestModel.cxx:401
CrestBaseResponse::page
std::optional< RespPage > page
Definition: CrestModel.h:46
CrestBaseResponse::to_json
json to_json() const
Definition: CrestModel.cxx:54
TagMetaSetDto::resources
std::vector< TagMetaDto > resources
Definition: CrestModel.h:259
TagMetaSetDto::to_json
json to_json() const
Definition: CrestModel.cxx:421
GenericMap::from_json
static GenericMap from_json(const json &j)
Definition: CrestModel.cxx:41