00001 #ifndef CDBBDBSHARED_CONDITION_P_ITR_HH 00002 #define CDBBDBSHARED_CONDITION_P_ITR_HH 00003 00004 // File and Version Information: 00005 // $Id: CdbBdbSConditionAtFolderPItr.hh,v 1.5 2003/08/13 23:36:20 gapon Exp $ 00006 00007 #include "BdbUtil/Bdb.hh" 00008 #include "ooMap.h" 00009 00010 #include "CdbBase/CdbIItr.hh" 00011 00012 /// The internal implementation for the iterator of persistent condition names. 00013 /** 00014 * This class provides the actual implementation of the corresponding 00015 * iterator interface. 00016 * 00017 * Remember, that the ROOT folder name is defined as a string returned 00018 * by the CdbPathName::separator() method. 00019 * 00020 * @see CdbIItr 00021 * @see CdbIItr::InterfaceType 00022 * @see CdbIItr::ValueType 00023 * @see CdbPathName::separator() 00024 */ 00025 class CdbBdbSConditionAtFolderPItr : public CdbIItr< const char* > { 00026 00027 public: 00028 00029 typedef CdbIItr< const char* >::ValueType ValueType; 00030 typedef CdbIItr< const char* >::InterfaceType InterfaceType; 00031 00032 private: 00033 00034 /// The default constructor (NOT IMPLEMENTED) 00035 /** 00036 * Cause there is no such thing as "default" condition. 00037 */ 00038 CdbBdbSConditionAtFolderPItr( ); 00039 00040 /// The copy constructor (NOT IMPLEMENTED) 00041 /** 00042 * This is beause the ooMapItr class does not have the copy constructor too. 00043 */ 00044 CdbBdbSConditionAtFolderPItr( const CdbBdbSConditionAtFolderPItr& theItr ); 00045 00046 /// The assignment operator (NOT IMPLEMENTED) 00047 /** 00048 * This is beause the ooMapItr class does not have the assignment operator too. 00049 */ 00050 CdbBdbSConditionAtFolderPItr& operator=( const CdbBdbSConditionAtFolderPItr& theItr ); 00051 00052 public: 00053 00054 /// The normal constructor 00055 /** 00056 * The (oo-)map object passed as a parameter must not be null. Otherwise 00057 * the constructor will abort the execution. 00058 */ 00059 CdbBdbSConditionAtFolderPItr( const BdbRef(BdbMap)& theMapRef /**< a (oo-)map with the collection of conditions names */ 00060 ); 00061 00062 /// The destructor 00063 /** 00064 * Details... 00065 */ 00066 virtual ~CdbBdbSConditionAtFolderPItr( ); 00067 00068 /// Reset an iterator to its initial state. 00069 /** 00070 * This implements the corresponding method of the base class. 00071 * 00072 * @see CdbIItr::reset 00073 * @see CdbStatus 00074 */ 00075 virtual CdbStatus reset( ); 00076 00077 /// Advance an iterator to the next position. 00078 /** 00079 * This implements the corresponding method of the base class. 00080 * 00081 * @see CdbIItr::next() 00082 */ 00083 virtual bool next( ); 00084 00085 /// Obtain the currently reffered value. 00086 /** 00087 * This implements the corresponding method of the base class. 00088 * 00089 * @see CdbIItr::value() 00090 * @see CdbIItr::ValueType 00091 * 00092 * @return the current value the iterator is set on 00093 */ 00094 virtual ValueType value( ); 00095 00096 /// Check if an iterator is valid. 00097 /** 00098 * This implements the corresponding method of the base class. 00099 * 00100 * @see CdbIItr::isValid() 00101 */ 00102 virtual bool isValid( ); 00103 00104 /// Make a clone of itself 00105 /** 00106 * @see CdbIItr::clone() 00107 * 00108 * WARNING: The current implementation of this method will return an instance 00109 * reset to the original state, as if no "next" method has ever been 00110 * called against it, even if the original instance is already 00111 * in the "isValid = true" state. 00112 * The reason of ths is that ooMapItr does not have neither copy ctor, 00113 * nor the assignment operator. 00114 */ 00115 virtual InterfaceType* clone( ) const; 00116 00117 private: 00118 00119 bool _isValid; 00120 bool _hasEverBeenAdvanced; 00121 00122 BdbRef(BdbMap) _mapRef; 00123 00124 ooMapItr _mapItr; 00125 ooString(32) _value; 00126 }; 00127 00128 #endif // CDBBDBSHARED_CONDITION_P_ITR_HH
1.3-rc3