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

#include <CrestModel.h>

Collaboration diagram for ChannelSetDto:

Public Member Functions

ChannelSetDtooperator= (const ChannelSetDto &)=default
 
ChannelSetDtooperator= (ChannelSetDto &&)=default
 
 ChannelSetDto ()
 
 ChannelSetDto (ChannelSetDto const &copy)
 
void add (std::string id, std::string name)
 
std::vector< std::pair< std::string, std::string > > getChannels () const
 
size_t getSize () const
 
json to_json () const
 

Static Public Member Functions

static ChannelSetDto from_json (const json &j)
 

Private Attributes

std::vector< std::pair< std::string, std::string > > m_channels
 

Detailed Description

Definition at line 172 of file CrestModel.h.

Constructor & Destructor Documentation

◆ ChannelSetDto() [1/2]

ChannelSetDto::ChannelSetDto ( )
inline

Definition at line 179 of file CrestModel.h.

179 {}

◆ ChannelSetDto() [2/2]

ChannelSetDto::ChannelSetDto ( ChannelSetDto const copy)
inline

Definition at line 180 of file CrestModel.h.

180 :m_channels(copy.getChannels()){}

Member Function Documentation

◆ add()

void ChannelSetDto::add ( std::string  id,
std::string  name 
)

Definition at line 293 of file CrestModel.cxx.

294 {
295  m_channels.push_back(std::pair<std::string, std::string>(id, name));
296 }

◆ from_json()

ChannelSetDto ChannelSetDto::from_json ( const json j)
static

Definition at line 297 of file CrestModel.cxx.

298 {
299  ChannelSetDto chDto;
300  for (unsigned int i = 0; i < j.size(); i++)
301  {
302  for (auto &el : j[i].items())
303  {
304  chDto.add(el.key(), el.value());
305  break;
306  }
307  }
308  return chDto;
309 }

◆ getChannels()

std::vector< std::pair<std::string,std::string> > ChannelSetDto::getChannels ( ) const
inline

Definition at line 182 of file CrestModel.h.

182 {return m_channels;}

◆ getSize()

size_t ChannelSetDto::getSize ( ) const
inline

Definition at line 183 of file CrestModel.h.

183 {return m_channels.size();}

◆ operator=() [1/2]

ChannelSetDto& ChannelSetDto::operator= ( ChannelSetDto &&  )
default

◆ operator=() [2/2]

ChannelSetDto& ChannelSetDto::operator= ( const ChannelSetDto )
default

◆ to_json()

json ChannelSetDto::to_json ( ) const

Definition at line 310 of file CrestModel.cxx.

311 {
312  json chJson = json::array();
313  for (auto &ch : m_channels)
314  {
315  json obj = {};
316  obj[ch.first] = ch.second;
317  chJson.push_back(obj);
318  }
319  return chJson;
320 }

Member Data Documentation

◆ m_channels

std::vector< std::pair<std::string,std::string> > ChannelSetDto::m_channels
private

Definition at line 174 of file CrestModel.h.


The documentation for this class was generated from the following files:
sendEI_SPB.ch
ch
Definition: sendEI_SPB.py:35
json
nlohmann::json json
Definition: HistogramDef.cxx:9
ChannelSetDto::m_channels
std::vector< std::pair< std::string, std::string > > m_channels
Definition: CrestModel.h:174
ChannelSetDto::add
void add(std::string id, std::string name)
Definition: CrestModel.cxx:293
ChannelSetDto
Definition: CrestModel.h:172
lumiFormat.i
int i
Definition: lumiFormat.py:85
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
lumiFormat.array
array
Definition: lumiFormat.py:91
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TrigJetMonitorAlgorithm.items
items
Definition: TrigJetMonitorAlgorithm.py:79
calibdata.copy
bool copy
Definition: calibdata.py:27
python.PyAthena.obj
obj
Definition: PyAthena.py:132