00001 #ifndef CDB_PATH_NAME_ITR_HH 00002 #define CDB_PATH_NAME_ITR_HH 00003 00004 // File and Version Information: 00005 // $Id: CdbPathNameItr.hh,v 1.4 2005/07/26 00:06:26 gapon Exp $ 00006 00007 #include "CdbBase/CdbIItr.hh" 00008 #include "CdbBase/CdbPathName.hh" 00009 00010 /// This class facilitates path name operations 00011 /** 00012 * This implementation of the iterator makes its own private 00013 * copy of the collection (a path whose elements are meant 00014 * to be iterated). 00015 */ 00016 class CdbPathNameItr : public CdbIItr<CdbPathName> { 00017 00018 public: 00019 00020 /// The default constructor 00021 /** 00022 * Initializes an iterator at the invalid state. 00023 * 00024 * @see CdbPathNameItr::IsValid() 00025 */ 00026 CdbPathNameItr( ); 00027 00028 /// The normal constructor 00029 /** 00030 * Initialize the iterator. 00031 */ 00032 CdbPathNameItr( const CdbPathName& thePath ); 00033 00034 /// The copy constructor 00035 /** 00036 * The constructed iterator borrows (not _shares_) the state of 00037 * the specified iterator. 00038 */ 00039 CdbPathNameItr( const CdbPathNameItr& theItr ); 00040 00041 /// The destructor 00042 00043 virtual ~CdbPathNameItr( ); 00044 00045 /// The assignment operator 00046 /** 00047 * The constructed iterator borrows (not _shares_) the state of 00048 * the specified iterator. 00049 */ 00050 CdbPathNameItr& operator=( const CdbPathNameItr& theItr ); 00051 00052 /// Reset an iterator to its initial state. 00053 /** 00054 * Implements the corresponding method of the base class. 00055 * 00056 * @see CdbIItr::reset() 00057 */ 00058 virtual CdbStatus reset( ); 00059 00060 /// Advance an iterator to the next position. 00061 /** 00062 * Implements the corresponding method of the base class. 00063 * 00064 * @see CdbIItr::next() 00065 */ 00066 virtual bool next( ); 00067 00068 /// Obtain the currently reffered value. 00069 /** 00070 * Implements the corresponding method of the base class. 00071 * 00072 * @see CdbIItr::value() 00073 */ 00074 virtual CdbPathName value( ); 00075 00076 /// Check if an iterator is valid. 00077 /** 00078 * Implements the corresponding method of the base class. 00079 * 00080 * @see CdbIItr::isValid() 00081 */ 00082 virtual bool isValid( ); 00083 00084 /// Make a clone of itself 00085 /** 00086 * Implements the corresponding method of the base class. 00087 * 00088 * @see CdbIItr::clone() 00089 */ 00090 virtual CdbIItr<CdbPathName>* clone( ) const; 00091 00092 private: 00093 00094 bool _isValid; 00095 bool _isEverAdvanced; 00096 00097 CdbPathName _myPath; 00098 00099 unsigned int _current; 00100 }; 00101 00102 #endif // CDB_PATH_NAME_ITR_HH
1.3-rc3