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

#include <CrestModel.h>

Inheritance diagram for StoreSetDto:
Collaboration diagram for StoreSetDto:

Public Member Functions

const char * getFormat () const
 
int64_t getSize () const
 
void push_back (StoreDto dto)
 
void clear ()
 
json to_json () const
 
void load_from_json (const json &j)
 

Static Public Member Functions

static StoreSetDto from_json (const json &j)
 

Public Attributes

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

Detailed Description

Definition at line 330 of file CrestModel.h.

Member Function Documentation

◆ clear()

void StoreSetDto::clear ( )

Definition at line 591 of file CrestModel.cxx.

592 {
593  resources.clear();
594 }

◆ from_json()

StoreSetDto StoreSetDto::from_json ( const json j)
static

Definition at line 596 of file CrestModel.cxx.

597 {
598  StoreSetDto storeSetDto;
599  json jsonResources = j.value("resources", json::array());
600  for (auto it = jsonResources.begin(); it != jsonResources.end(); ++it)
601  {
602  storeSetDto.push_back(StoreDto::from_json(*it));
603  }
604 
605  return storeSetDto;
606 }

◆ getFormat()

const char* StoreSetDto::getFormat ( ) const
inlinevirtual

Implements CrestBaseResponse.

Definition at line 334 of file CrestModel.h.

334 {return "StoreSetDto";}

◆ getSize()

int64_t StoreSetDto::getSize ( ) const
inlinevirtual

Implements CrestBaseResponse.

Definition at line 335 of file CrestModel.h.

335 {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 }

◆ push_back()

void StoreSetDto::push_back ( StoreDto  dto)

Definition at line 587 of file CrestModel.cxx.

588 {
589  resources.push_back(dto);
590 }

◆ to_json()

json StoreSetDto::to_json ( ) const

Definition at line 576 of file CrestModel.cxx.

577 {
578  json baseJson = CrestBaseResponse::to_json();
579  json jsonResources = json::array();
580  for (const auto &resource : resources)
581  {
582  jsonResources.push_back(((StoreDto)resource).to_json());
583  }
584  baseJson["resources"] = jsonResources;
585  return baseJson;
586 }

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<StoreDto> StoreSetDto::resources

Definition at line 333 of file CrestModel.h.


The documentation for this class was generated from the following files:
StoreDto
Definition: CrestModel.h:301
RespPage::from_json
static RespPage from_json(const json &j)
Definition: CrestModel.cxx:20
json
nlohmann::json json
Definition: HistogramDef.cxx:9
skel.it
it
Definition: skel.GENtoEVGEN.py:396
CrestBaseResponse::filter
std::optional< GenericMap > filter
Definition: CrestModel.h:47
StoreSetDto::push_back
void push_back(StoreDto dto)
Definition: CrestModel.cxx:587
CrestBaseResponse::datatype
std::optional< std::string > datatype
Definition: CrestModel.h:45
lumiFormat.array
array
Definition: lumiFormat.py:91
StoreSetDto::resources
std::vector< StoreDto > resources
Definition: CrestModel.h:333
StoreDto::from_json
static StoreDto from_json(const json &j)
Definition: CrestModel.cxx:566
StoreSetDto::to_json
json to_json() const
Definition: CrestModel.cxx:576
CrestBaseResponse::page
std::optional< RespPage > page
Definition: CrestModel.h:46
CrestBaseResponse::to_json
json to_json() const
Definition: CrestModel.cxx:54
StoreSetDto
Definition: CrestModel.h:331
GenericMap::from_json
static GenericMap from_json(const json &j)
Definition: CrestModel.cxx:41