LCIO  "2.7.4"
 All Classes Namespaces Functions Variables Typedefs Friends Pages
LCCollectionVec.h
1 #ifndef EVENT_LCCOLLECTIONVEC_H
2 #define EVENT_LCCOLLECTIONVEC_H 1
3 
4 #include <string>
5 #include <vector>
6 
7 #include "EVENT/LCCollection.h"
8 #include "EVENT/LCObject.h"
9 #include "AccessChecked.h"
10 #include "LCParametersImpl.h"
11 
12 //#include "LCIO.h"
13 
14 namespace IMPL {
15 
16  // typedef std::vector<EVENT::LCObject*> LCObjectVec ;
17 
27  , public AccessChecked {
28 
29 
30  public: // this is needed for the auto generated streamer in the ROOT dictionary !!!
31  //protected
35  LCCollectionVec() : _flag(0) { /* no default c'tor */ }
36 
37  public:
38 
40  LCCollectionVec( const std::string& type ) ;
41 
42  /* Coppy constructor creating a deep copy of an LCCollection.
43  */
44  // LCCollectionVec( const EVENT::LCCollection& col ) ;
45 
46 
49  virtual ~LCCollectionVec() ;
50 
53  virtual int getNumberOfElements() const ;
54 
57  virtual const std::string & getTypeName() const ;
58 
61  virtual EVENT::LCObject * getElementAt(int index) const ;
62 
77  virtual int getFlag() const ;
78 
79 
83  virtual bool isTransient() const ;
84 
85 
89  void setTransient(bool val=true) ;
90 
95  virtual bool isDefault() const ;
96 
100  void setDefault(bool val=true) ;
101 
102 
108  virtual bool isSubset() const ;
109 
116  void setSubset(bool val=true) ;
117 
118 
121  void setFlag(int flag) ;
122 
123 
129  virtual void addElement(EVENT::LCObject * obj) throw (EVENT::ReadOnlyException) ;
130 
136  virtual void removeElementAt(int i) throw (EVENT::ReadOnlyException) ;
137 
140  virtual const EVENT::LCParameters & getParameters() const { return _params ; }
141 
144  virtual EVENT::LCParameters & parameters() { return _params ; }
145 
146 
147  protected:
148  void setReadOnly(bool readOnly) ;
149 
150  std::string _typeName ;
151  int _flag ;
152  LCParametersImpl _params ;
153  // int _access ;
154 
155 }; // class
156 } // namespace IMPL
157 #endif /* ifndef EVENT_LCCOLLECTIONVEC_H */
The generic object that is held in an LCCollection.
Definition: LCObject.h:30
virtual EVENT::LCParameters & parameters()
Parameters defined for this run.
Definition: LCCollectionVec.h:144
virtual int getNumberOfElements() const
Returns the number of entries in the collection.
Definition: LCCollectionVec.cc:70
void setSubset(bool val=true)
Sets the subset flag for this collection.
Definition: LCCollectionVec.cc:108
virtual EVENT::LCObject * getElementAt(int index) const
Returns pointer to element at index - no range check !.
Definition: LCCollectionVec.cc:81
void setDefault(bool val=true)
Sets the default flag for this collection.
Definition: LCCollectionVec.cc:99
Implementation of the LCCollection using (inheriting from) an STL vector of LCObjects.
Definition: LCCollectionVec.h:26
std::vector< LCObject * > LCObjectVec
Vector of (pointers to) LCObjects.
Definition: LCObject.h:17
LCCollectionVec()
Default Constructor should be protected - every LCCollection needs to know the type of its elements...
Definition: LCCollectionVec.h:35
virtual const EVENT::LCParameters & getParameters() const
Parameters defined for this run.
Definition: LCCollectionVec.h:140
virtual bool isDefault() const
True if collection is the default collection for the given type.
Definition: LCCollectionVec.cc:95
void setTransient(bool val=true)
Sets the transient flag for this collection.
Definition: LCCollectionVec.cc:89
void setFlag(int flag)
Sets the flag word for this collection.
Definition: LCCollectionVec.cc:119
virtual ~LCCollectionVec()
Destructor.
Definition: LCCollectionVec.cc:54
Implementation of Simple interface to store generic named parameters of type int, float and string...
Definition: LCParametersImpl.h:35
virtual const std::string & getTypeName() const
Returns the type name of the collection - valid names are defined in LCIO.
Definition: LCCollectionVec.cc:75
Simple interface to store generic named parameters of type int, float and string. ...
Definition: LCParameters.h:28
virtual bool isSubset() const
True if the collection holds a subset of objects from other collections.
Definition: LCCollectionVec.cc:104
virtual void addElement(EVENT::LCObject *obj)
Adds the given element to (end of) the collection.
Definition: LCCollectionVec.cc:124
The generic collection used in LCIO.
Definition: LCCollection.h:29
virtual int getFlag() const
Returns flag word for collection.
Definition: LCCollectionVec.cc:114
virtual void removeElementAt(int i)
Removes the i-th element from the collection.
Definition: LCCollectionVec.cc:132
Controls access to objects.
Definition: AccessChecked.h:17
virtual bool isTransient() const
True if collection is transient, i.e.
Definition: LCCollectionVec.cc:85
EventException used for signaling a 'read only exception'.
Definition: Exceptions.h:74