Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | Related Pages

EVENT::LCCollection Class Reference

The generic collection used in LCIO. More...

#include <EVENT/LCCollection.h>

Inheritance diagram for EVENT::LCCollection:

IMPL::LCCollectionVec IOIMPL::LCCollectionIOVec List of all members.

Public Member Functions

virtual ~LCCollection ()
 Destructor.
virtual int getNumberOfElements () const =0
 Returns the number of elements in the collection.
virtual const std::string & getTypeName () const =0
 Returns the type name of the collection - valid names are defined in LCIO.
virtual LCObjectgetElementAt (int index) const =0
 Returns pointer to element at index - no range check, use getNumberOfEntries().
virtual int getFlag () const =0
 Returns flag word for collection.
virtual bool isTransient () const =0
 True if collection is transient, i.e.
virtual bool isDefault () const =0
 True if collection is the default collection for the given type.
virtual bool isSubset () const =0
 True if the collection holds a subset of objects from other collections.
virtual void addElement (LCObject *obj)=0 throw (ReadOnlyException, std::exception )
 Adds the given element to (end of) the collection.
virtual void removeElementAt (int i)=0 throw (ReadOnlyException, std::exception )
 Removes the i-th element from the collection.
virtual void setFlag (int flag)=0
 Set the flag word.
virtual const LCParametersgetParameters () const =0
 Parameters defined for this collection.
virtual LCParametersparameters ()=0
 Parameters defined for this collection.

Static Public Attributes

const int BITTransient = 16
 Transient bit in flag word.
const int BITDefault = 17
const int BITSubset = 18

Detailed Description

The generic collection used in LCIO.

Holds arbitrary objects of type LCObject.

Author:
gaede
Version:
Id
LCCollection.aid,v 1.11 2005/03/02 16:22:58 gaede Exp
See also:
LCObject

LCIO


Member Function Documentation

virtual void EVENT::LCCollection::addElement LCObject obj  )  throw (ReadOnlyException, std::exception ) [pure virtual]
 

Adds the given element to (end of) the collection.

Throws an exception if the collection (event) is 'read only'.

Exceptions:
ReadOnlyException 

virtual int EVENT::LCCollection::getFlag  )  const [pure virtual]
 

Returns flag word for collection.

Bits 16-31 are reserved for LCIO Depending on the object type stored they have a special meaning, e.g. for SimCalorimeterHits:
CHBIT_LONG = 31 - store position
CHBIT_BARREL = 30 - endcap or barrel
CHBIT_ID1 = 29 - cellid1 is sored
CHBIT_PDG = 28 - store pdg of secondaries
 
Bit 16 is used to flag collection as transient
Bit 17 is used to flag collection as default
Bit 18 is used to flag collection as subset
Bits 0-15 are subdetector/user specific.

See also:
isTransient()

Implemented in IMPL::LCCollectionVec.

virtual int EVENT::LCCollection::getNumberOfElements  )  const [pure virtual]
 

Returns the number of elements in the collection.

Same as size().

Implemented in IMPL::LCCollectionVec.

virtual bool EVENT::LCCollection::isDefault  )  const [pure virtual]
 

True if collection is the default collection for the given type.

This implies that the collection is complete and unambigous. Convenient method that checks bit BITDefault of the flag word.

Implemented in IMPL::LCCollectionVec.

virtual bool EVENT::LCCollection::isSubset  )  const [pure virtual]
 

True if the collection holds a subset of objects from other collections.

If the collection is not transient only the pointers/references to the original objects will be stored. Convenient method that checks bit BITSubset of the flag word.

Implemented in IMPL::LCCollectionVec.

virtual bool EVENT::LCCollection::isTransient  )  const [pure virtual]
 

True if collection is transient, i.e.

will not be written to any LCIO file. Convenient method that checks bit BITTransient of the flag word.

Implemented in IMPL::LCCollectionVec.

virtual LCParameters& EVENT::LCCollection::parameters  )  [pure virtual]
 

Parameters defined for this collection.

Can be used to modify the collection paramters.

Implemented in IMPL::LCCollectionVec.

virtual void EVENT::LCCollection::removeElementAt int  i  )  throw (ReadOnlyException, std::exception ) [pure virtual]
 

Removes the i-th element from the collection.

Throws an exception if the collection (event) is 'read only'.

Exceptions:
ReadOnlyException 

Implemented in IMPL::LCCollectionVec.

virtual void EVENT::LCCollection::setFlag int  flag  )  [pure virtual]
 

Set the flag word.

This is allowed in 'read only' mode.

Implemented in IMPL::LCCollectionVec.


The documentation for this class was generated from the following file:
Generated on Wed Dec 2 17:39:54 2009 for LCIO by  doxygen 1.3.9.1