LCIO  "2.7.4"
 All Classes Namespaces Functions Variables Typedefs Friends Pages
Public Member Functions | Protected Attributes | List of all members
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 >:

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
 

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 obj)
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>
LCGenericObjectImpl* UTIL::LCFixedObject< NINT, NFLOAT, NDOUBLE >::obj ( )
inline

The LCGenericObjectImpl .

Sublcasses use this to access their data.

Referenced by UTIL::LCFixedObject< NINT, NFLOAT, NDOUBLE >::LCFixedObject().


The documentation for this class was generated from the following file: