Template class for fixed size LCGenericObject subclasses. More...
#include <UTIL/LCFixedObject.h>
Public Member Functions | |
LCFixedObject (const LCFixedObject &) | |
default copy constructor - use with care | |
LCFixedObject & | operator= (const LCFixedObject &) |
default assignment operator - use with care | |
LCFixedObject () | |
Default c'tor. | |
LCFixedObject (LCObject *object) | |
C'tor to be used for elements of LCGenericObjects read from an LCIO file or the database. | |
IMPL::LCGenericObjectImpl * | obj () |
The LCGenericObjectImpl . | |
virtual | ~LCFixedObject () |
Clean up if we created a new LCGenericObjectImpl. | |
virtual int | id () const |
Return the id of the underlying LCGenericObjectImpl. | |
int | getNInt () const |
Number of integer values stored in this object. | |
int | getNFloat () const |
Number of float values stored in this object. | |
int | getNDouble () const |
Number of double values stored in this object. | |
int | getIntVal (int index) const |
Returns the integer value for the given index. | |
float | getFloatVal (int index) const |
Returns the float value for the given index. | |
double | getDoubleVal (int index) const |
Returns the double value for the given index. | |
bool | isFixedSize () const |
True if objects of the implementation class have a fixed size, i.e getNInt, getNFloat and getNDouble will return values that are constant during the lifetime of the object. |
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().
UTIL::LCFixedObject< NINT, NFLOAT, NDOUBLE >::LCFixedObject | ( | LCObject * | object | ) | [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().
IMPL::LCGenericObjectImpl* UTIL::LCFixedObject< NINT, NFLOAT, NDOUBLE >::obj | ( | ) | [inline] |
The LCGenericObjectImpl .
Sublcasses use this to access their data.
Referenced by CalibrationConstant::CalibrationConstant(), and UTIL::LCFixedObject< NINT, NFLOAT, NDOUBLE >::LCFixedObject().