00001 #ifndef DDF_PROPERTYITERATOR_H 00002 #define DDF_PROPERTYITERATOR_H 00003 00004 #include <iterator> 00005 #include <vector> 00006 00007 #include "node.h" 00008 00009 namespace afl 00010 { 00011 namespace ddf 00012 { 00013 class Node; 00014 class Property; 00015 00020 class PropertyIterator : std::iterator<std::random_access_iterator_tag, Node> 00021 { 00022 00024 public: 00028 PropertyIterator( ); 00029 00035 PropertyIterator( const PropertyIterator& toCopy ); 00036 00042 PropertyIterator& operator=( const PropertyIterator& toCopy ); 00043 00049 PropertyIterator& operator-=( ptrdiff_t dec ); 00050 00056 PropertyIterator& operator+=( ptrdiff_t toInc ); 00057 00063 ptrdiff_t operator-( const PropertyIterator& toDiff ) const; 00064 00070 PropertyIterator operator-( ptrdiff_t delta ) const; 00071 00077 bool operator>=( const PropertyIterator& toCompare ) const; 00078 00084 bool operator!=( const PropertyIterator& toCompare ) const; 00085 00091 bool operator==( const PropertyIterator& toCompare ) const; 00092 00098 bool operator>( const PropertyIterator& toCompare ) const; 00099 00105 bool operator<( const PropertyIterator& toCompare ) const; 00106 00112 bool operator<=( const PropertyIterator& toCompare ) const; 00113 00117 PropertyIterator& operator++( ); 00118 00122 PropertyIterator operator++( int ); 00123 00127 PropertyIterator& operator--( ); 00128 00132 PropertyIterator operator--( int ); 00133 00139 PropertyIterator operator+( ptrdiff_t inc ) const; 00140 00144 pointer operator->( ); 00145 00149 const pointer operator->( ) const ; 00150 00154 reference operator*( ); 00155 00159 const reference operator*( ) const; 00160 00166 reference operator[]( int n ); 00167 00173 const reference operator[]( int n ) const; 00174 00175 00177 private: 00178 friend class Property; 00184 PropertyIterator( const std::vector<Node>::iterator& iter ); 00185 00186 00187 00190 private: 00194 std::vector<Node>::iterator _iter; 00195 00196 }; 00197 00198 } 00199 } 00200 00201 afl::ddf::PropertyIterator operator+( ptrdiff_t inc, const afl::ddf::PropertyIterator& iter ); 00202 00203 #endif // PROPERTYITERATOR_H 00204