00001 // -*- C++ -*- 00002 // AID-GENERATED 00003 // ========================================================================= 00004 // This class was generated by AID - Abstract Interface Definition 00005 // DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it. 00006 // ========================================================================= 00007 #ifndef EVENT_LCCOLLECTION_H 00008 #define EVENT_LCCOLLECTION_H 1 00009 00010 #include <string> 00011 00012 #include "Exceptions.h" 00013 00014 namespace EVENT { 00015 00016 class LCObject; 00017 class LCParameters; 00018 00019 /** The generic collection used in LCIO. Holds arbitrary objects of type LCObject. 00020 * 00021 * @author gaede 00022 * @version $Id: LCCollection.aid,v 1.11 2005/03/02 16:22:58 gaede Exp $ 00023 * @see LCObject 00024 * @see LCIO 00025 */ 00026 00027 00028 00029 class LCCollection { 00030 00031 public: 00032 /// Destructor. 00033 virtual ~LCCollection() { /* nop */; } 00034 00035 /**Returns the number of elements in the collection. 00036 * Same as size(). 00037 */ 00038 virtual int getNumberOfElements() const = 0; 00039 00040 /** Returns the type name of the collection - valid names are defined in LCIO. 00041 */ 00042 virtual const std::string & getTypeName() const = 0; 00043 00044 /** Returns pointer to element at index - no range check, use getNumberOfEntries(). 00045 */ 00046 virtual LCObject * getElementAt(int index) const = 0; 00047 00048 /** Returns flag word for collection. Bits 16-31 are reserved for LCIO 00049 * Depending on the object type stored they have a special meaning, e.g. 00050 * for SimCalorimeterHits: <br> 00051 * CHBIT_LONG = 31 - store position <br> 00052 * CHBIT_BARREL = 30 - endcap or barrel <br> 00053 * CHBIT_ID1 = 29 - cellid1 is sored <br> 00054 * CHBIT_PDG = 28 - store pdg of secondaries <br> 00055 * <br> 00056 * Bit 16 is used to flag collection as transient <br> 00057 * Bit 17 is used to flag collection as default <br> 00058 * Bit 18 is used to flag collection as subset <br> 00059 * Bits 0-15 are subdetector/user specific. 00060 * @see isTransient() 00061 */ 00062 virtual int getFlag() const = 0; 00063 00064 /**Transient bit in flag word. 00065 */ 00066 00067 00068 static const int BITTransient = 16 ; 00069 static const int BITDefault = 17 ; 00070 static const int BITSubset = 18 ; 00071 /** True if collection is transient, i.e. will not be written to any LCIO file. 00072 * Convenient method that checks bit BITTransient of the flag word. 00073 */ 00074 virtual bool isTransient() const = 0; 00075 00076 /** True if collection is the default collection for the given type. 00077 * This implies that the collection is complete and unambigous. 00078 * Convenient method that checks bit BITDefault of the flag word. 00079 */ 00080 virtual bool isDefault() const = 0; 00081 00082 /** True if the collection holds a subset of objects from other collections. 00083 * If the collection is not transient only the pointers/references to the original 00084 * objects will be stored. 00085 * Convenient method that checks bit BITSubset of the flag word. 00086 */ 00087 virtual bool isSubset() const = 0; 00088 00089 /** Adds the given element to (end of) the collection. Throws an exception 00090 * if the collection (event) is 'read only'. 00091 * 00092 * @throws ReadOnlyException 00093 */ 00094 virtual void addElement(LCObject * obj) throw (ReadOnlyException, std::exception ) = 0; 00095 00096 /** Removes the i-th element from the collection. Throws an exception 00097 * if the collection (event) is 'read only'. 00098 * 00099 * @throws ReadOnlyException 00100 */ 00101 virtual void removeElementAt(int i) throw (ReadOnlyException, std::exception ) = 0; 00102 00103 /** Set the flag word. This is allowed in 'read only' mode. 00104 */ 00105 virtual void setFlag(int flag) = 0; 00106 00107 /** Parameters defined for this collection. 00108 */ 00109 virtual const LCParameters & getParameters() const = 0; 00110 00111 /** Parameters defined for this collection. 00112 * Can be used to modify the collection paramters. 00113 */ 00114 virtual LCParameters & parameters() = 0; 00115 }; // class 00116 } // namespace EVENT 00117 #endif /* ifndef EVENT_LCCOLLECTION_H */
1.3.9.1