13 #ifndef DD4HEP_CONDITIONS_CONDITIONSDATA_H
14 #define DD4HEP_CONDITIONS_CONDITIONSDATA_H
29 namespace Conditions {
57 typedef std::map<std::string, OpaqueDataBlock>
Params;
75 Params::const_iterator i=
params.begin();
76 if ( i !=
params.end() )
return (*i);
77 throw std::runtime_error(
"AbstractMap: Failed to access non-existing first parameter");
81 Params::iterator i=
params.begin();
82 if ( i !=
params.end() )
return (*i);
83 throw std::runtime_error(
"AbstractMap: Failed to access non-existing first parameter");
86 template <
typename T>
const T&
first()
const {
87 Params::const_iterator i=
params.begin();
88 if ( i !=
params.end() )
return (*i).second.get<
T>();
89 throw std::runtime_error(
"AbstractMap: Failed to access non-existing first item");
93 Params::iterator i=
params.begin();
94 if ( i !=
params.end() )
return (*i).second.get<
T>();
95 throw std::runtime_error(
"AbstractMap: Failed to access non-existing first item");
98 template <
typename T>
const T&
operator[](
const std::string& item)
const {
99 Params::const_iterator i=
params.find(item);
100 if ( i !=
params.end() )
return (*i).second.get<
T>();
101 throw std::runtime_error(
"AbstractMap: Failed to access non-existing item:"+item);
105 Params::iterator i=
params.find(item);
106 if ( i !=
params.end() )
return (*i).second.get<
T>();
107 throw std::runtime_error(
"AbstractMap: Failed to access non-existing item:"+item);
const Params::value_type & firstParam() const
Simplify access to first item of the parameter list (const access)
Params::value_type & firstParam()
Simplify access to first item of the parameter list.
virtual ~ClientData()
Default destructor.
const T & operator[](const std::string &item) const
Simplify access to mapped item of the parameter list (const access)
T * option() const
Simplify access to client data.
const T & first() const
Simplify access to first item of the parameter list (const access)
AbstractMap & operator=(const AbstractMap &c)
Assignment operator.
virtual ~AbstractMap()
Default destructor.
Conditions data block. Internally maps other objects to abstract data blocks.
T & first()
Simplify access to first item of the parameter list.
std::map< std::string, OpaqueDataBlock > Params
T & operator[](const std::string &item)
Simplify access to mapped item of the parameter list.
AbstractMap()
Default constructor.