CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
cond::OMSServiceResult Class Reference

#include <OMSAccess.h>

Public Member Functions

OMSServiceResultIterator begin () const
 
bool empty () const
 
OMSServiceResultIterator end () const
 
 OMSServiceResult ()
 
size_t parseData (const std::string &data)
 
size_t size () const
 

Private Attributes

boost::property_tree::ptree * m_data
 
boost::property_tree::ptree m_root
 

Detailed Description

Definition at line 143 of file OMSAccess.h.

Constructor & Destructor Documentation

◆ OMSServiceResult()

cond::OMSServiceResult::OMSServiceResult ( )

Definition at line 30 of file OMSAccess.cc.

30 {}

Member Function Documentation

◆ begin()

OMSServiceResultIterator cond::OMSServiceResult::begin ( void  ) const

Definition at line 32 of file OMSAccess.cc.

References m_data.

Referenced by LHCInfoImpl::makeFillPayload().

32 { return OMSServiceResultIterator(m_data->begin()); }
boost::property_tree::ptree * m_data
Definition: OMSAccess.h:161

◆ empty()

bool cond::OMSServiceResult::empty ( ) const

Definition at line 59 of file OMSAccess.cc.

References size().

Referenced by LHCInfoImpl::makeFillPayload().

59 { return size() == 0; }
size_t size() const
Definition: OMSAccess.cc:51

◆ end()

OMSServiceResultIterator cond::OMSServiceResult::end ( void  ) const

Definition at line 34 of file OMSAccess.cc.

References m_data.

Referenced by Types.LuminosityBlockRange::cppID(), and Types.EventRange::cppID().

34 { return OMSServiceResultIterator(m_data->end()); }
boost::property_tree::ptree * m_data
Definition: OMSAccess.h:161

◆ parseData()

size_t cond::OMSServiceResult::parseData ( const std::string &  data)

Definition at line 36 of file OMSAccess.cc.

References data, m_data, and m_root.

36  {
37  m_data = nullptr;
38  std::stringstream sout;
39  sout << data;
40  try {
41  boost::property_tree::read_json(sout, m_root);
42  } catch (boost::property_tree::json_parser_error const& ex) {
43  throw cond::Exception(ex.what(), "OMSServiceResult::parseData");
44  }
45  if (!m_root.empty()) {
46  m_data = &m_root.get_child("data");
47  }
48  return m_root.size();
49  }
persistency::Exception Exception
Definition: Exception.h:25
boost::property_tree::ptree * m_data
Definition: OMSAccess.h:161
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
boost::property_tree::ptree m_root
Definition: OMSAccess.h:160

◆ size()

size_t cond::OMSServiceResult::size ( void  ) const

Definition at line 51 of file OMSAccess.cc.

References m_data, and runTheMatrix::ret.

Referenced by ntupleDataFormat._Collection::__iter__(), ntupleDataFormat._Collection::__len__(), and empty().

51  {
52  size_t ret = 0;
53  if (m_data) {
54  ret = m_data->size();
55  }
56  return ret;
57  }
boost::property_tree::ptree * m_data
Definition: OMSAccess.h:161
ret
prodAgent to be discontinued

Member Data Documentation

◆ m_data

boost::property_tree::ptree* cond::OMSServiceResult::m_data
private

Definition at line 161 of file OMSAccess.h.

Referenced by begin(), end(), parseData(), and size().

◆ m_root

boost::property_tree::ptree cond::OMSServiceResult::m_root
private

Definition at line 160 of file OMSAccess.h.

Referenced by parseData().