26 using namespace DD4hep;
29 OpaqueData::OpaqueData() : grammar(0), pointer(0) {
54 throw runtime_error(
"Opaque data block is unbound. Cannot parse string representation.");
62 throw runtime_error(
"Opaque data block is unbound. Cannot create string representation.");
70 throw runtime_error(
"Opaque data block is unbound. Cannot determine type information!");
78 throw runtime_error(
"Opaque data block is unbound. Cannot determine type information!");
145 except(
"OpaqueData",
"You may not bind opaque data multiple times!");
165 except(
"OpaqueData",
"You may not bind opaque multiple times!");
174 except(
"OpaqueData",
"Opaque data block is unbound. Cannot copy data.");
177 except(
"OpaqueData",
"Bad data binding binding");
virtual const std::string & type_name() const =0
Access to the type information name.
Class describing an opaque conditions data block.
OpaqueDataBlock & operator=(const OpaqueDataBlock &clone)
Assignment operator.
virtual const std::type_info & type() const =0
Access to the type information.
virtual std::string str(const void *ptr) const =0
Serialize an opaque value to a string.
static void decrement(T *)
Decrement count according to type information.
Base class describing string evaluation to C++ objects using boost::spirit.
Class describing an opaque data block.
OpaqueDataBlock()
Standard initializing constructor.
int except(const std::string &src, const std::string &fmt,...)
Calls the display action with ERROR and throws an std::runtime_error exception.
virtual size_t sizeOf() const =0
Access the object size (sizeof operator)
void(* copy)(void *, const void *)
Constructor function – only set if the object is valid.
std::string str() const
Create string representation of the data block.
bool move(OpaqueDataBlock &from)
Move the data content: 'from' will be reset to NULL.
virtual ~OpaqueData()
Standard Destructor.
OpaqueData()
Standard initializing constructor.
virtual bool fromString(void *ptr, const std::string &value) const =0
Set value from serialized string. On successful data conversion TRUE is returned. ...
bool fromString(const std::string &rep)
Create data block from string representation.
static void increment(T *)
Increment count according to type information.
const std::string & dataType() const
Access type name of the condition data block.
void * pointer
Pointer to object data.
unsigned char data[sizeof(std::vector< void * >)]
Data buffer: plain data are allocated directly on this buffer.
void assign(const void *ptr, const std::type_info &typ)
Set data value.
const BasicGrammar * grammar
Data type.
T & bind()
Bind data value.
OpaqueData & operator=(const OpaqueData &c)
Assignment operator.
void typeinfoCheck(const std::type_info &typ1, const std::type_info &typ2, const std::string &text="")
Check type infos for equivalence (dynamic casts) using ABI information.
const std::type_info & typeInfo() const
Access type id of the condition.
~OpaqueDataBlock()
Standard Destructor.
unsigned int type
Data buffer type: Must be a bitmap!
void(* destruct)(void *)
Destructor function – only set if the object is valid.