Template class for fixed size LCGenericObject subclasses. More...
#include <UTIL/LCFixedObject.h>
Public Member Functions | |
LCFixedObject () | |
Default c'tor. | |
LCFixedObject (LCObject *obj) | |
C'tor to be used for elements of LCGenericObjects read from an LCIO file or the database. More... | |
LCGenericObjectImpl * | obj () |
The LCGenericObjectImpl . More... | |
virtual | ~LCFixedObject () |
Clean up if we created a new LCGenericObjectImpl. | |
virtual int | id () const |
Return the id of the underlying LCGenericObjectImpl. | |
int | getNInt () const |
int | getNFloat () const |
int | getNDouble () const |
int | getIntVal (int index) const |
float | getFloatVal (int index) const |
double | getDoubleVal (int index) const |
bool | isFixedSize () const |
Protected Attributes | |
LCGenericObjectImpl * | _obj |
bool | _createdObject |
Template class for fixed size LCGenericObject subclasses.
By inheriting from this class users can very easily implement their own objects.
It uses an instance of LCGenericObjectImpl that holds the data, thus there is no overhead when the data is read from a database or file for copying it to some local structure (Decorator pattern).
This is still an abstract class: subclasses have to implement LCGenericObject::getTypeName() and LCGenericObject::getDataDescription().
|
inline |
C'tor to be used for elements of LCGenericObjects read from an LCIO file or the database.
Subclasses should 'override' this, e.g.:
Myclass(LCObject* obj) : LCFixedObject(obj) {}
References UTIL::LCFixedObject< NINT, NFLOAT, NDOUBLE >::obj().
|
inline |
The LCGenericObjectImpl .
Sublcasses use this to access their data.
Referenced by UTIL::LCFixedObject< NINT, NFLOAT, NDOUBLE >::LCFixedObject().