LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 <LCFixedObject.h>

+ Inheritance diagram for UTIL::LCFixedObject< NINT, NFLOAT, NDOUBLE >:

Public Member Functions

 LCFixedObject (const LCFixedObject &)=default
 default copy constructor - use with care More...
 
LCFixedObjectoperator= (const LCFixedObject &)=default
 default assignment operator - use with care More...
 
 LCFixedObject ()
 Default c'tor. More...
 
 LCFixedObject (LCObject *object)
 C'tor to be used for elements of LCGenericObjects read from an LCIO file or the database. More...
 
IMPL::LCGenericObjectImplobj ()
 The LCGenericObjectImpl . More...
 
virtual ~LCFixedObject ()
 Clean up if we created a new LCGenericObjectImpl. More...
 
virtual int id () const
 Return the id of the underlying LCGenericObjectImpl. More...
 
int getNInt () const
 Number of integer values stored in this object. More...
 
int getNFloat () const
 Number of float values stored in this object. More...
 
int getNDouble () const
 Number of double values stored in this object. More...
 
int getIntVal (int index) const
 Returns the integer value for the given index. More...
 
float getFloatVal (int index) const
 Returns the float value for the given index. More...
 
double getDoubleVal (int index) const
 Returns the double value for the given index. More...
 
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. More...
 
- Public Member Functions inherited from EVENT::LCGenericObject
virtual ~LCGenericObject ()
 Destructor. More...
 
virtual const std::string getTypeName () const =0
 The type name of the user class (typically the class name) This type name is stored as a collection parameter "TypeName" with every collection of LCGenericObject subclasses. More...
 
virtual const std::string getDataDescription () const =0
 The description string. More...
 
- Public Member Functions inherited from EVENT::LCObject
virtual ~LCObject ()
 Destructor. More...
 
virtual LCObjectclone () const
 Returns an object id for internal (debugging) use in LCIO. More...
 
- Public Member Functions inherited from lcrtrel::LCRTRelations
template<class V >
V::ext_type ext ()
 Provides access to an extension object - the type and ownership is defined by the class V which should be a subtype of LCExtension, LCOwnedExtension, LCExtensionVector, LCExtensionList,... More...
 
template<class V >
const V::ext_type ext () const
 Provides access to an extension object - the type and ownership is defined by the class V which should be a subtype of LCExtension, LCOwnedExtension, LCExtensionVector, LCExtensionList,... More...
 
template<class V >
V::rel_type rel ()
 Provides read access to relations - the object types and their connectivity are defined by the class V which has to be a subtype of either LC1To1Relation, LC1ToNRelation or LCNToNRelation. More...
 

Protected Attributes

IMPL::LCGenericObjectImpl_obj {NULL}
 
bool _createdObject {false}
 

Additional Inherited Members

- Public Types inherited from EVENT::LCGenericObject
typedef LCGenericObject lcobject_type
 Useful typedef for template programming with LCIO. More...
 
- Public Types inherited from lcrtrel::LCRTRelations
typedef std::type_index ext_index
 
typedef std::shared_ptr< void > ext_type
 
typedef std::map< ext_index,
ext_type
ext_map
 

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

Definition at line 25 of file LCFixedObject.h.

Constructor & Destructor Documentation

template<int NINT, int NFLOAT, int NDOUBLE>
UTIL::LCFixedObject< NINT, NFLOAT, NDOUBLE >::LCFixedObject ( const LCFixedObject< NINT, NFLOAT, NDOUBLE > &  )
default

default copy constructor - use with care

template<int NINT, int NFLOAT, int NDOUBLE>
UTIL::LCFixedObject< NINT, NFLOAT, NDOUBLE >::LCFixedObject ( )
inline

Default c'tor.

Definition at line 37 of file LCFixedObject.h.

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) {}

Definition at line 48 of file LCFixedObject.h.

template<int NINT, int NFLOAT, int NDOUBLE>
virtual UTIL::LCFixedObject< NINT, NFLOAT, NDOUBLE >::~LCFixedObject ( )
inlinevirtual

Clean up if we created a new LCGenericObjectImpl.

Definition at line 85 of file LCFixedObject.h.

Member Function Documentation

template<int NINT, int NFLOAT, int NDOUBLE>
double UTIL::LCFixedObject< NINT, NFLOAT, NDOUBLE >::getDoubleVal ( int  index) const
inlinevirtual

Returns the double value for the given index.

Implements EVENT::LCGenericObject.

Definition at line 106 of file LCFixedObject.h.

template<int NINT, int NFLOAT, int NDOUBLE>
float UTIL::LCFixedObject< NINT, NFLOAT, NDOUBLE >::getFloatVal ( int  index) const
inlinevirtual

Returns the float value for the given index.

Implements EVENT::LCGenericObject.

Definition at line 103 of file LCFixedObject.h.

template<int NINT, int NFLOAT, int NDOUBLE>
int UTIL::LCFixedObject< NINT, NFLOAT, NDOUBLE >::getIntVal ( int  index) const
inlinevirtual

Returns the integer value for the given index.

Implements EVENT::LCGenericObject.

Definition at line 100 of file LCFixedObject.h.

template<int NINT, int NFLOAT, int NDOUBLE>
int UTIL::LCFixedObject< NINT, NFLOAT, NDOUBLE >::getNDouble ( ) const
inlinevirtual

Number of double values stored in this object.

Implements EVENT::LCGenericObject.

Definition at line 98 of file LCFixedObject.h.

template<int NINT, int NFLOAT, int NDOUBLE>
int UTIL::LCFixedObject< NINT, NFLOAT, NDOUBLE >::getNFloat ( ) const
inlinevirtual

Number of float values stored in this object.

Implements EVENT::LCGenericObject.

Definition at line 97 of file LCFixedObject.h.

template<int NINT, int NFLOAT, int NDOUBLE>
int UTIL::LCFixedObject< NINT, NFLOAT, NDOUBLE >::getNInt ( ) const
inlinevirtual

Number of integer values stored in this object.

Implements EVENT::LCGenericObject.

Definition at line 96 of file LCFixedObject.h.

template<int NINT, int NFLOAT, int NDOUBLE>
virtual int UTIL::LCFixedObject< NINT, NFLOAT, NDOUBLE >::id ( ) const
inlinevirtual

Return the id of the underlying LCGenericObjectImpl.

Reimplemented from EVENT::LCGenericObject.

Definition at line 91 of file LCFixedObject.h.

template<int NINT, int NFLOAT, int NDOUBLE>
bool UTIL::LCFixedObject< NINT, NFLOAT, NDOUBLE >::isFixedSize ( ) const
inlinevirtual

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.

Implements EVENT::LCGenericObject.

Definition at line 109 of file LCFixedObject.h.

template<int NINT, int NFLOAT, int NDOUBLE>
IMPL::LCGenericObjectImpl* UTIL::LCFixedObject< NINT, NFLOAT, NDOUBLE >::obj ( )
inline
template<int NINT, int NFLOAT, int NDOUBLE>
LCFixedObject& UTIL::LCFixedObject< NINT, NFLOAT, NDOUBLE >::operator= ( const LCFixedObject< NINT, NFLOAT, NDOUBLE > &  )
default

default assignment operator - use with care

Member Data Documentation

template<int NINT, int NFLOAT, int NDOUBLE>
bool UTIL::LCFixedObject< NINT, NFLOAT, NDOUBLE >::_createdObject {false}
protected
template<int NINT, int NFLOAT, int NDOUBLE>
IMPL::LCGenericObjectImpl* UTIL::LCFixedObject< NINT, NFLOAT, NDOUBLE >::_obj {NULL}
protected

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