LCIO  "2.7.4"
 All Classes Namespaces Functions Variables Typedefs Friends Pages
LCParametersImpl.h
1 // -*- C++ -*-
2 #ifndef EVENT_LCPARAMETERSIMPL_H
3 #define EVENT_LCPARAMETERSIMPL_H 1
4 
5 #include "EVENT/LCParameters.h"
6 #include "IMPL/AccessChecked.h"
7 
8 #include <map>
9 #include <vector>
10 
11 namespace IMPL {
12 
13 
14  class LCRunHeaderImpl ;
15  class LCEventImpl ;
16  class LCCollectionVec ;
17 
18  typedef std::map< std::string, EVENT::IntVec > IntMap ;
19  typedef std::map< std::string, EVENT::FloatVec > FloatMap ;
20  typedef std::map< std::string, EVENT::StringVec > StringMap ;
21 
22 
36 
37  friend class LCRunHeaderImpl ;
38  friend class LCEventImpl ;
39  friend class LCCollectionVec ;
40 
41  public:
42 
43  LCParametersImpl() ;
44 
46  virtual ~LCParametersImpl() { /* nop */; }
47 
50  virtual int getIntVal(const std::string & key) const ;
51 
54  virtual float getFloatVal(const std::string & key) const ;
55 
58  virtual const std::string & getStringVal(const std::string & key) const ;
59 
63  virtual EVENT::IntVec & getIntVals(const std::string & key, EVENT::IntVec & values) const ;
64 
68  virtual EVENT::FloatVec & getFloatVals(const std::string & key, EVENT::FloatVec & values) const ;
69 
73  virtual EVENT::StringVec & getStringVals(const std::string & key, EVENT::StringVec & values) const ;
74 
77  virtual const EVENT::StringVec & getIntKeys( EVENT::StringVec & keys) const ;
78 
81  virtual const EVENT::StringVec & getFloatKeys(EVENT::StringVec & keys) const ;
82 
85  virtual const EVENT::StringVec & getStringKeys(EVENT::StringVec & keys) const ;
86 
89  virtual int getNInt(const std::string & key) const ;
90 
93  virtual int getNFloat(const std::string & key) const ;
94 
97  virtual int getNString(const std::string & key) const ;
98 
101  virtual void setValue(const std::string & key, int value) ;
102 
105  virtual void setValue(const std::string & key, float value) ;
106 
109  virtual void setValue(const std::string & key, const std::string & value) ;
110 
113  virtual void setValues(const std::string & key, const EVENT::IntVec & values);
114 
117  virtual void setValues(const std::string & key, const EVENT::FloatVec & values);
118 
121  virtual void setValues(const std::string & key, const EVENT::StringVec & values);
122 
123 
124  protected:
125 
126  mutable IntMap _intMap ;
127  mutable FloatMap _floatMap ;
128  mutable StringMap _stringMap ;
129 
130  }; // class
131 } // namespace IMPL
132 #endif /* ifndef EVENT_LCPARAMETERSIMPL_H */
virtual const EVENT::StringVec & getIntKeys(EVENT::StringVec &keys) const
Returns a list of all keys of integer parameters.
Definition: LCParametersImpl.cc:81
std::vector< std::string > StringVec
Vector of strings.
Definition: LCIOSTLTypes.h:16
virtual EVENT::IntVec & getIntVals(const std::string &key, EVENT::IntVec &values) const
Adds all integer values for the given key to values.
Definition: LCParametersImpl.cc:49
Implementation of the LCCollection using (inheriting from) an STL vector of LCObjects.
Definition: LCCollectionVec.h:26
Implementation of the main event class.
Definition: LCEventImpl.h:31
virtual int getNString(const std::string &key) const
The number of string values stored for this key.
Definition: LCParametersImpl.cc:132
virtual EVENT::StringVec & getStringVals(const std::string &key, EVENT::StringVec &values) const
Adds all float values for the given key to values.
Definition: LCParametersImpl.cc:70
std::vector< float > FloatVec
Vector of floats.
Definition: LCIOSTLTypes.h:18
virtual int getNFloat(const std::string &key) const
The number of float values stored for this key.
Definition: LCParametersImpl.cc:122
virtual ~LCParametersImpl()
Destructor.
Definition: LCParametersImpl.h:46
virtual void setValues(const std::string &key, const EVENT::IntVec &values)
Set integer values for the given key.
Definition: LCParametersImpl.cc:166
virtual const std::string & getStringVal(const std::string &key) const
Returns the first string value for the given key.
Definition: LCParametersImpl.cc:36
virtual int getNInt(const std::string &key) const
The number of integer values stored for this key.
Definition: LCParametersImpl.cc:112
Implementation of LCRunHeader.
Definition: LCRunHeaderImpl.h:18
Implementation of Simple interface to store generic named parameters of type int, float and string...
Definition: LCParametersImpl.h:35
virtual float getFloatVal(const std::string &key) const
Returns the first float value for the given key.
Definition: LCParametersImpl.cc:25
Simple interface to store generic named parameters of type int, float and string. ...
Definition: LCParameters.h:28
std::vector< int > IntVec
Vector of ints.
Definition: LCIOSTLTypes.h:22
virtual EVENT::FloatVec & getFloatVals(const std::string &key, EVENT::FloatVec &values) const
Adds all float values for the given key to values.
Definition: LCParametersImpl.cc:60
virtual const EVENT::StringVec & getFloatKeys(EVENT::StringVec &keys) const
Returns a list of all keys of float parameters.
Definition: LCParametersImpl.cc:92
virtual const EVENT::StringVec & getStringKeys(EVENT::StringVec &keys) const
Returns a list of all keys of string parameters.
Definition: LCParametersImpl.cc:102
Controls access to objects.
Definition: AccessChecked.h:17
virtual void setValue(const std::string &key, int value)
Set integer value for the given key.
Definition: LCParametersImpl.cc:142
virtual int getIntVal(const std::string &key) const
Returns the first integer value for the given key.
Definition: LCParametersImpl.cc:14