DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Class describing an opaque conditions data block. More...
#include <OpaqueData.h>
Public Types | |
enum | _DataTypes { PLAIN_DATA = 1<<0, ALLOC_DATA = 1<<1, STACK_DATA = 1<<2, BOUND_DATA = 1<<3, EXTERN_DATA = 1<<4 } |
Public Member Functions | |
OpaqueDataBlock () | |
Standard initializing constructor. More... | |
template<typename OBJECT > | |
OpaqueDataBlock (OBJECT &&data) | |
Initializing constructor binding data to buffer with move. More... | |
OpaqueDataBlock (const OpaqueDataBlock ©) | |
Copy constructor (Required by ROOT dictionaries) More... | |
~OpaqueDataBlock () | |
Standard Destructor. More... | |
OpaqueDataBlock & | operator= (const OpaqueDataBlock ©) |
Assignment operator (Required by ROOT dictionaries) More... | |
void * | ptr () const |
Write access to the data buffer. Is only valid after call to bind<T>() More... | |
void * | bind (const BasicGrammar *grammar) |
Bind data value. More... | |
void * | bind (void *ptr, size_t len, const BasicGrammar *grammar) |
Bind data value in place. More... | |
void | bindExtern (void *ptr, const BasicGrammar *grammar) |
Bind external data value to the pointer. More... | |
template<typename T , typename... Args> | |
T & | construct (Args... args) |
Construct conditions object and bind the data. More... | |
template<typename T > | |
T & | bind () |
Bind data value. More... | |
template<typename T > | |
T & | bind (void *ptr, size_t len) |
Bind data value. More... | |
template<typename T > | |
T & | bind (const std::string &value) |
Bind data value. More... | |
template<typename T > | |
T & | bind (void *ptr, size_t len, const std::string &value) |
Bind data value. More... | |
template<typename T > | |
T & | bind (T &&data) |
Bind data value. More... | |
template<typename T > | |
void | bindExtern (T *ptr) |
Bind external data value to the pointer. More... | |
Public Member Functions inherited from dd4hep::OpaqueData | |
bool | fromString (const std::string &rep) |
No ROOT persistency. More... | |
std::string | str () const |
Create string representation of the data block. More... | |
const std::type_info & | typeInfo () const |
Access type id of the condition. More... | |
const std::string & | dataType () const |
Access type name of the condition data block. More... | |
const void * | ptr () const |
Access to the data buffer (read only!). Is only valid after call to bind<T>() More... | |
bool | is_bound () const |
Check if object is already bound.... More... | |
template<typename T > | |
T & | get () |
Generic getter. Specify the exact type, not a polymorph type. More... | |
template<typename T > | |
const T & | get () const |
Generic getter (const version). Specify the exact type, not a polymorph type. More... | |
template<typename T > | |
T & | as () |
Generic getter. Resolves polymorph types. It is mandatory that the datatype is polymorph! More... | |
template<typename T > | |
const T & | as () const |
Generic getter (const version). Resolves polymorph types. It is mandatory that the datatype is polymorph! More... | |
Public Attributes | |
unsigned int | type |
Data buffer type: Must be a bitmap of enum _DataTypes! More... | |
Public Attributes inherited from dd4hep::OpaqueData | |
const BasicGrammar * | grammar = 0 |
Data type. More... | |
Static Public Attributes | |
constexpr static const size_t | BUFFER_SIZE = 40 |
Buffer size of the in-place data buffer. More... | |
Protected Attributes | |
unsigned char | data [BUFFER_SIZE] |
Data buffer: plain data are allocated directly on this buffer. More... | |
Protected Attributes inherited from dd4hep::OpaqueData | |
void * | pointer = 0 |
No ROOT persistency. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from dd4hep::OpaqueData | |
OpaqueData ()=default | |
Standard initializing constructor. More... | |
virtual | ~OpaqueData ()=default |
Standard Destructor. More... | |
OpaqueData (const OpaqueData ©)=default | |
Copy constructor. More... | |
OpaqueData & | operator= (const OpaqueData ©)=default |
Assignment operator. More... | |
Class describing an opaque conditions data block.
This class is used to handle the actual data IO. Hence, we have write access to the data in abstract form.
Definition at line 92 of file OpaqueData.h.
Enumerator | |
---|---|
PLAIN_DATA | |
ALLOC_DATA | |
STACK_DATA | |
BOUND_DATA | |
EXTERN_DATA |
Definition at line 111 of file OpaqueData.h.
OpaqueDataBlock::OpaqueDataBlock | ( | ) |
Standard initializing constructor.
Definition at line 58 of file OpaqueData.cpp.
dd4hep::OpaqueDataBlock::OpaqueDataBlock | ( | OBJECT && | data | ) |
Initializing constructor binding data to buffer with move.
Definition at line 187 of file OpaqueData.h.
OpaqueDataBlock::OpaqueDataBlock | ( | const OpaqueDataBlock & | copy | ) |
Copy constructor (Required by ROOT dictionaries)
Copy constructor.
Definition at line 63 of file OpaqueData.cpp.
OpaqueDataBlock::~OpaqueDataBlock | ( | ) |
Standard Destructor.
Definition at line 79 of file OpaqueData.cpp.
|
inline |
Bind data value.
Definition at line 199 of file OpaqueData.h.
void * OpaqueDataBlock::bind | ( | const BasicGrammar * | grammar | ) |
Bind data value.
Definition at line 124 of file OpaqueData.cpp.
|
inline |
|
inline |
Bind data value.
Definition at line 205 of file OpaqueData.h.
|
inline |
Bind data value.
Definition at line 211 of file OpaqueData.h.
void * OpaqueDataBlock::bind | ( | void * | ptr, |
size_t | len, | ||
const BasicGrammar * | grammar | ||
) |
|
inline |
|
inline |
Bind external data value to the pointer.
Definition at line 236 of file OpaqueData.h.
void OpaqueDataBlock::bindExtern | ( | void * | ptr, |
const BasicGrammar * | grammar | ||
) |
Bind external data value to the pointer.
Definition at line 146 of file OpaqueData.cpp.
|
inline |
Construct conditions object and bind the data.
Definition at line 193 of file OpaqueData.h.
OpaqueDataBlock & OpaqueDataBlock::operator= | ( | const OpaqueDataBlock & | copy | ) |
Assignment operator (Required by ROOT dictionaries)
Copy constructor.
Definition at line 90 of file OpaqueData.cpp.
|
inline |
Write access to the data buffer. Is only valid after call to bind<T>()
Definition at line 133 of file OpaqueData.h.
|
staticconstexpr |
Buffer size of the in-place data buffer.
Definition at line 96 of file OpaqueData.h.
|
protected |
Data buffer: plain data are allocated directly on this buffer.
This internal data buffer is sufficient to store any STL vector, list, map, etc. and hence should be sufficient to probably store normal relatively primitive basic objects.
It appears that on clang the size of std::any is 32 bytes (16 bytes on g++_, whereas the size of std::vector is 24. Lets take 40 bytes and check it in the Conditions_any_basic example...
Definition at line 108 of file OpaqueData.h.
unsigned int dd4hep::OpaqueDataBlock::type |
Data buffer type: Must be a bitmap of enum _DataTypes!
Definition at line 119 of file OpaqueData.h.