00001 #ifndef CDBBDBSHARED_FOLDER_P_ITR_HH 00002 #define CDBBDBSHARED_FOLDER_P_ITR_HH 00003 00004 // File and Version Information: 00005 // $Id: CdbBdbSFolderPItr.hh,v 1.4 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 folder 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 CdbBdbSFolderPItr : 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 copy constructor (IS DISABLED) 00035 /** 00036 * This is beause the ooMapItr class does not have the copy constructor too. 00037 */ 00038 CdbBdbSFolderPItr( const CdbBdbSFolderPItr& theItr ); 00039 00040 /// The assignment operator (IS DISABLED) 00041 /** 00042 * This is beause the ooMapItr class does not have the assignment operator too. 00043 */ 00044 CdbBdbSFolderPItr& operator=( const CdbBdbSFolderPItr& theItr ); 00045 00046 public: 00047 00048 /// The normal and default constructor 00049 /** 00050 * If the default constructor is chosen then it means that the "root" folder 00051 * would be the only product of this iterator. This simplest scenario does not involve 00052 * any operations with the persistent store. 00053 * 00054 * If the (oo-)map object is not null one then this map will be searched 00055 * to get a list of names. THese operations will inevitably go into 00056 * the persistent store. 00057 */ 00058 CdbBdbSFolderPItr( const BdbRef(ooMap)& theMapRef = 0 /**< a (oo-)map with the collection of folders names */ 00059 ); 00060 00061 /// The destructor 00062 /** 00063 * Details... 00064 */ 00065 virtual ~CdbBdbSFolderPItr( ); 00066 00067 /// Reset an iterator to its initial state. 00068 /** 00069 * This implements the corresponding method of the base class. 00070 * 00071 * @see CdbIItr::reset 00072 * @see CdbStatus 00073 */ 00074 virtual CdbStatus reset( ); 00075 00076 /// Advance an iterator to the next position. 00077 /** 00078 * This implements the corresponding method of the base class. 00079 * 00080 * @see CdbIItr::next() 00081 */ 00082 virtual bool next( ); 00083 00084 /// Obtain the currently reffered value. 00085 /** 00086 * This implements the corresponding method of the base class. 00087 * 00088 * @see CdbIItr::value() 00089 * @see CdbIItr::ValueType 00090 * 00091 * @return the current value the iterator is set on 00092 */ 00093 virtual ValueType value( ); 00094 00095 /// Check if an iterator is valid. 00096 /** 00097 * This implements the corresponding method of the base class. 00098 * 00099 * @see CdbIItr::isValid() 00100 */ 00101 virtual bool isValid( ); 00102 00103 /// Make a clone of itself 00104 /** 00105 * @see CdbIItr::clone() 00106 * 00107 * WARNING: The current implementation of this method will return an instance 00108 * reset to the original state, as if no "next" method has ever been 00109 * called against it, even if the original instance is already 00110 * in the "isValid = true" state. 00111 * The reason of ths is that ooMapItr does not have neither copy ctor, 00112 * nor the assignment operator. 00113 */ 00114 virtual InterfaceType* clone( ) const; 00115 00116 private: 00117 00118 bool _isValid; 00119 bool _hasEverBeenAdvanced; 00120 00121 BdbRef(ooMap) _mapRef; 00122 00123 ooMapItr _mapItr; 00124 ooString(32) _value; 00125 }; 00126 00127 #endif // CDBBDBSHARED_FOLDER_P_ITR_HH
1.3-rc3