CMS 3D CMS Logo

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

#include <OMSAccess.h>

Public Member Functions

OMSServiceResultRef back () const
 
OMSServiceResultIterator begin () const
 
bool empty () const
 
OMSServiceResultIterator end () const
 
OMSServiceResultRef front () 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 149 of file OMSAccess.h.

Constructor & Destructor Documentation

◆ OMSServiceResult()

cond::OMSServiceResult::OMSServiceResult ( )

Definition at line 30 of file OMSAccess.cc.

30 {}

Member Function Documentation

◆ back()

OMSServiceResultRef cond::OMSServiceResult::back ( ) const

Definition at line 41 of file OMSAccess.cc.

References m_data.

41  {
42  auto& attributeList = m_data->back().second.get_child("attributes");
43  return OMSServiceResultRef(&attributeList);
44  }
boost::property_tree::ptree * m_data
Definition: OMSAccess.h:170

◆ begin()

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

Definition at line 32 of file OMSAccess.cc.

References m_data.

Referenced by theLHCInfoPerFillImpl::makeFillPayload(), LHCInfoImpl::makeFillPayload(), and LHCInfoPerLSPopConSourceHandler::makeFillPayload().

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

◆ empty()

bool cond::OMSServiceResult::empty ( ) const

◆ 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:170

◆ front()

OMSServiceResultRef cond::OMSServiceResult::front ( ) const

Definition at line 36 of file OMSAccess.cc.

References m_data.

36  {
37  auto& attributeList = m_data->front().second.get_child("attributes");
38  return OMSServiceResultRef(&attributeList);
39  }
boost::property_tree::ptree * m_data
Definition: OMSAccess.h:170

◆ parseData()

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

Definition at line 46 of file OMSAccess.cc.

References data, m_data, and m_root.

46  {
47  m_data = nullptr;
48  std::stringstream sout;
49  sout << data;
50  try {
51  boost::property_tree::read_json(sout, m_root);
52  } catch (boost::property_tree::json_parser_error const& ex) {
53  throw cond::Exception(ex.what(), "OMSServiceResult::parseData");
54  }
55  if (!m_root.empty()) {
56  m_data = &m_root.get_child("data");
57  }
58  return m_root.size();
59  }
persistency::Exception Exception
Definition: Exception.h:25
boost::property_tree::ptree * m_data
Definition: OMSAccess.h:170
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
boost::property_tree::ptree m_root
Definition: OMSAccess.h:169

◆ size()

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

Definition at line 61 of file OMSAccess.cc.

References m_data, and runTheMatrix::ret.

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

61  {
62  size_t ret = 0;
63  if (m_data) {
64  ret = m_data->size();
65  }
66  return ret;
67  }
boost::property_tree::ptree * m_data
Definition: OMSAccess.h:170
ret
prodAgent to be discontinued

Member Data Documentation

◆ m_data

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

Definition at line 170 of file OMSAccess.h.

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

◆ m_root

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

Definition at line 169 of file OMSAccess.h.

Referenced by parseData().