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

#include <CrestModel.h>

Collaboration diagram for PayloadSpecDto:

Public Member Functions

PayloadSpecDtooperator= (const PayloadSpecDto &)=default
 
PayloadSpecDtooperator= (PayloadSpecDto &&)=default
 
 PayloadSpecDto ()
 
 PayloadSpecDto (PayloadSpecDto const &copy)
 
const std::vector< std::pair< std::string, std::string > > & getColumns () const
 
size_t getSize () const
 
void add (const std::string &name, const std::string &type)
 
json to_json () const
 

Static Public Member Functions

static PayloadSpecDto from_json (const json &j)
 

Private Attributes

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

Detailed Description

Definition at line 188 of file CrestModel.h.

Constructor & Destructor Documentation

◆ PayloadSpecDto() [1/2]

PayloadSpecDto::PayloadSpecDto ( )
inline

Definition at line 194 of file CrestModel.h.

194 {}

◆ PayloadSpecDto() [2/2]

PayloadSpecDto::PayloadSpecDto ( PayloadSpecDto const copy)
inline

Definition at line 195 of file CrestModel.h.

195 :m_row(copy.getColumns()){}

Member Function Documentation

◆ add()

void PayloadSpecDto::add ( const std::string &  name,
const std::string &  type 
)

Definition at line 321 of file CrestModel.cxx.

322 {
323  m_row.push_back(std::pair<std::string, std::string>(name, type));
324 }

◆ from_json()

PayloadSpecDto PayloadSpecDto::from_json ( const json j)
static

Definition at line 325 of file CrestModel.cxx.

326 {
327  PayloadSpecDto chDto;
328  //old format
329  if(!j.is_object()&&!j.is_array()){
330  std::string regex=R"delim(([^\s,:]*):\s?([^\s,]*),?)delim";
332  boost::smatch what;
333  std::string input=j.dump();
334  input=boost::regex_replace(input,boost::regex("\""),"");
335  bool match=boost::regex_search(input, what, expression);
336  while (match){
337  std::string n(what[1]);
338  std::string t(what[2]);
339  chDto.add(boost::regex_replace(n, boost::regex("(^[ ]+)|([ ]+$)"),""),boost::regex_replace(t, boost::regex("(^[ ]+)|([ ]+$)"),""));
340  input = what.suffix();
341  match=boost::regex_search(input, what, expression);
342  }
343  return chDto;
344  }
345  for (unsigned int i = 0; i < j.size(); i++)
346  {
347  for (auto &el : j[i].items())
348  {
349  chDto.add(el.key(), el.value());
350  break;
351  }
352  }
353  return chDto;
354 }

◆ getColumns()

const std::vector< std::pair<std::string,std::string> >& PayloadSpecDto::getColumns ( ) const
inline

Definition at line 196 of file CrestModel.h.

196 {return m_row;}

◆ getSize()

size_t PayloadSpecDto::getSize ( ) const
inline

Definition at line 197 of file CrestModel.h.

197 {return m_row.size();}

◆ operator=() [1/2]

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

◆ operator=() [2/2]

PayloadSpecDto& PayloadSpecDto::operator= ( PayloadSpecDto &&  )
default

◆ to_json()

json PayloadSpecDto::to_json ( ) const

Definition at line 355 of file CrestModel.cxx.

356 {
357  json chJson = json::array();
358  for (auto &ch : m_row)
359  {
360  json obj = {};
361  obj[ch.first] = ch.second;
362  chJson.push_back(obj);
363  }
364  return chJson;
365 }

Member Data Documentation

◆ m_row

std::vector< std::pair<std::string,std::string> > PayloadSpecDto::m_row
private

Definition at line 190 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
PayloadSpecDto
Definition: CrestModel.h:188
PayloadSpecDto::m_row
std::vector< std::pair< std::string, std::string > > m_row
Definition: CrestModel.h:190
python.HION12.expression
string expression
Definition: HION12.py:55
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
PrepareReferenceFile.regex
regex
Definition: PrepareReferenceFile.py:43
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
PayloadSpecDto::add
void add(const std::string &name, const std::string &type)
Definition: CrestModel.cxx:321
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
lumiFormat.array
array
Definition: lumiFormat.py:91
python.ExitCodes.what
def what(code)
Definition: ExitCodes.py:73
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TrigJetMonitorAlgorithm.items
items
Definition: TrigJetMonitorAlgorithm.py:79
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
calibdata.copy
bool copy
Definition: calibdata.py:27
python.PyAthena.obj
obj
Definition: PyAthena.py:132
match
bool match(std::string s1, std::string s2)
match the individual directories of two strings
Definition: hcg.cxx:356