![]() |
|
|
Bdb packages | Design docs | Source docs | Guidelines | Recent releases |
|
Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Compound Members File Members /TagData/TagTransient.hh
Go to the documentation of this file.00001 //-------------------------------------------------------------------------- 00002 // File and Version Information: 00003 // $Id: TagTransient.hh,v 1.8 2001/10/31 00:04:08 brownd Exp $ 00004 // 00005 // Description: 00006 // Class TagTransient. Interface definition file for transient event tag. 00007 // 00008 // Environment: 00009 // Software developed for the BaBar Detector at the SLAC B-Factory. 00010 // 00011 // Author List: 00012 // David R. Quarrie Original Author 00013 // 00014 // Copyright Information: 00015 // Copyright (C) 1998 Lawrence Berkeley Laboratory 00016 // 00017 //------------------------------------------------------------------------ 00018 00019 #ifndef TAGTRANSIENT_HH 00020 #define TAGTRANSIENT_HH 00021 00022 //----------------- 00023 // BaBar Headers -- 00024 //----------------- 00025 #include "BaBar/BaBar.hh" 00026 00027 //---------------------- 00028 // Base Class Headers -- 00029 //---------------------- 00030 #include "AbsEventTag/AbsEventTag.hh" 00031 00032 //------------------------------------ 00033 // Collaborating Class Declarations -- 00034 //------------------------------------ 00035 #include "rw/tvhdict.h" 00036 #include "rw/cstring.h" 00037 00038 // --------------------- 00039 // -- Class Interface -- 00040 // --------------------- 00041 00042 /** 00043 ** The TagTransient class. This is an interface for the transient event tag. 00044 ** 00045 ** The event tag contains named integer, float and boolean elements. The 00046 ** name of each element must be unique, independent of the data type. 00047 ** 00048 ** Copyright (C) 1998 Lawrence Berkeley National Laboratory 00049 ** 00050 ** @version $Id: TagTransient.hh,v 1.8 2001/10/31 00:04:08 brownd Exp $ 00051 ** 00052 ** @author (David R. Quarrie) Originator 00053 **/ 00054 00055 class TagTransient : public AbsEventTag { 00056 00057 //-------------------- 00058 // Instance Members -- 00059 //-------------------- 00060 00061 public: 00062 00063 // Constructors 00064 TagTransient( ); 00065 00066 TagTransient( const TagTransient& anotherTag); 00067 00068 TagTransient& operator = (const TagTransient& other); 00069 00070 // Destructor 00071 virtual ~TagTransient( ); 00072 00073 // Selectors 00074 // RWTValHashDictionary<RWCString, bool>* bools ( ) const; 00075 // RWTValHashDictionary<RWCString, int>* ints ( ) const; 00076 // RWTValHashDictionary<RWCString, float>* floats( ) const; 00077 00078 // Operations 00079 /** 00080 ** Retrieve a boolean tag element. The "key" argument is used as 00081 ** the key for identifying the element. The function value indicates 00082 ** whether the specified tag element exists, and the "value" argument 00083 ** is used to return the value of the element. 00084 **/ 00085 virtual bool getBool ( bool& value, const char* const key ) const; 00086 00087 /** 00088 ** Retrieve an integer tag element. The "key" argument is used as 00089 ** the key for identifying the element. The function value indicates 00090 ** whether the specified tag element exists, and the "value" argument 00091 ** is used to return the value of the element. 00092 **/ 00093 virtual bool getInt ( int& value, const char* const key ) const; 00094 00095 /** 00096 ** Retrieve float tag element. The "key" argument is used as 00097 ** the key for identifying the element. The function value indicates 00098 ** whether the specified tag element exists, and the "value" argument 00099 ** is used to return the value of the element. 00100 **/ 00101 virtual bool getFloat( float& value, const char* const key ) const; 00102 00103 /** 00104 ** Insert a boolean tag element. The "key" argument is used as 00105 ** the key for identifying the element. The function value indicates 00106 ** whether the insertion was successful. A failure indicates that 00107 ** the specified name is already in use for an element of another 00108 ** basic datatype. The "value" argument specifies the value of the 00109 ** element. 00110 **/ 00111 virtual bool putBool ( bool value, const char* const key ); 00112 00113 /** 00114 ** Insert an integer tag element. The "key" argument is used as 00115 ** the key for identifying the element. The function value indicates 00116 ** whether the insertion was successful. A failure indicates that 00117 ** the specified name is already in use for an element of another 00118 ** basic datatype. The "value" argument specifies the value of the 00119 ** element. 00120 **/ 00121 virtual bool putInt ( int value, const char* const key ); 00122 00123 /** 00124 ** Insert a float tag element. The "key" argument is used as 00125 ** the key for identifying the element. The function value indicates 00126 ** whether the insertion was successful. A failure indicates that 00127 ** the specified name is already in use for an element of another 00128 ** basic datatype. The "value" argument specifies the value of the 00129 ** element. 00130 **/ 00131 virtual bool putFloat( float value, const char* const key ); 00132 00133 /** 00134 ** Insert a packed integer tag element. The ownership of the packer is 00135 ** taken. 00136 **/ 00137 virtual bool putInt ( int value, const char* const key, 00138 ComPackBase<int>* packer); 00139 00140 /** 00141 ** Insert a packed float tag element. 00142 **/ 00143 virtual bool putFloat( float value, const char* const key, 00144 ComPackBase<float>* packer); 00145 00146 /** 00147 ** Merge the contents with another tag 00148 ** @param iwin specifies which value to use in case of name collision: 00149 ** true -- use own value 00150 ** false -- use other value 00151 **/ 00152 virtual bool merge( AbsEventTag* anotherTag, bool iwin ); 00153 00154 /** 00155 ** Return an iterator that allows the boolean elements to be 00156 ** retrieved from the tag. It is the responsibility of the client 00157 ** to delete this iterator after use. 00158 **/ 00159 virtual AbsEventTagBoolIter* boolIter ( ); 00160 00161 /** 00162 ** Return an iterator that allows the integer elements to be 00163 ** retrieved from the tag. It is the responsibility of the client 00164 ** to delete this iterator after use. 00165 **/ 00166 virtual AbsEventTagIntIter* intIter ( ); 00167 00168 /** 00169 ** Return an iterator that allows the float elements to be 00170 ** retrieved from the tag. It is the responsibility of the client 00171 ** to delete this iterator after use. 00172 **/ 00173 virtual AbsEventTagFloatIter* floatIter( ); 00174 00175 void lock() {_locked = true;} 00176 protected: 00177 00178 RWTValHashDictionary<RWCString, bool>* _bools; 00179 RWTValHashDictionary<RWCString, int>* _ints; 00180 RWTValHashDictionary<RWCString, float>* _floats; 00181 00182 bool _locked; 00183 00184 friend class TagTransientBoolIter; 00185 friend class TagTransientIntIter; 00186 friend class TagTransientFloatIter; 00187 }; 00188 00189 #endif
BaBar Public Site | SLAC | News | Links | Who's Who | Contact Us
Page Owner: Jacek Becla
Last Update: October 04, 2002