UTIL::LCFixedObject< NINT, NFLOAT, NDOUBLE > Class Template Reference

Template class for fixed size LCGenericObject subclasses. More...

#include <UTIL/LCFixedObject.h>

Inheritance diagram for UTIL::LCFixedObject< NINT, NFLOAT, NDOUBLE >:
EVENT::LCGenericObject EVENT::LCObject lcrtrel::LCRTRelations CalibrationConstant

List of all members.

Public Member Functions

 LCFixedObject (const LCFixedObject &)
 default copy constructor - use with care
LCFixedObjectoperator= (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::LCGenericObjectImplobj ()
 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.

Detailed Description

template<int NINT, int NFLOAT, int NDOUBLE>
class UTIL::LCFixedObject< NINT, NFLOAT, NDOUBLE >

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().

Author:
gaede
Version:
Id
LCFixedObject.h,v 1.3 2011-03-13 12:41:49 gaede Exp

Constructor & Destructor Documentation

template<int NINT, int NFLOAT, int NDOUBLE>
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().


Member Function Documentation

template<int NINT, int NFLOAT, int NDOUBLE>
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().


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Friends

Generated on 6 Mar 2020 for LCIO by  doxygen 1.6.1