libmoost
|
*** This class is NOT thread safe *** More...
#include <kvds_key_iterator.hpp>
Public Types | |
typedef kvdsT::key_type | key_type |
Public Member Functions | |
KvdsKeyIterator () | |
KvdsKeyIterator (kvdsT const &kvds) | |
KvdsKeyIterator (ikvds_ptr_t ikvds_ptr) | |
KvdsKeyIterator (KvdsKeyIterator const &rhs) | |
KvdsKeyIterator & | operator= (KvdsKeyIterator const &rhs) |
KvdsKeyIterator & | operator++ () |
KvdsKeyIterator | operator++ (int) |
bool | operator== (KvdsKeyIterator const &rhs) const |
bool | operator!= (KvdsKeyIterator const &rhs) const |
key_type const & | operator* () const |
Private Types | |
typedef kvdsT::kvds_key_t | kvds_key_t |
Private Member Functions | |
void | get_next_key () |
void | init () |
Private Attributes | |
key_type | key__ |
kvds_key_t | key_ |
size_t | pos_ |
ikvds_ptr_t | ikvds_ptr_ |
*** This class is NOT thread safe ***
Unfortunately, not all datastores support 'cursors' which could be used to encapsulate the iterator semantics inside the iterator and would have meant begin() and end() methods could have been provided on Kvds. Instead, the semantics of this iterator are very similar to an istream_iterator in so far as you must provide it a source to iterate over. The iterator process may modify the state of the source. Since this is the case, it must be noted that only one iterator can sucessfully operate on the source at any one time and any operation that modifies the source other than by calling the iterator shall leave the iterator in an invalid state. This iterator is a sequencial forward reading, read-only iterator. Upon construction, the iterator needs to be passed a kvds source. It will ensure The source is reading to start reading from the very first key in the store. Keys are not iterated in any specific order since some of the datastores do support this. The special case of an iterator constructed without a source represents the end iterator (again, just like istream_iterator). This iterator returns keys, oyou must operform a seperate lookup using that key if you wish to obtain the value(s) associated with it.
Definition at line 64 of file kvds_key_iterator.hpp.
typedef kvdsT::key_type moost::kvds::KvdsKeyIterator< kvdsT >::key_type |
Definition at line 67 of file kvds_key_iterator.hpp.
typedef kvdsT::kvds_key_t moost::kvds::KvdsKeyIterator< kvdsT >::kvds_key_t [private] |
Definition at line 70 of file kvds_key_iterator.hpp.
moost::kvds::KvdsKeyIterator< kvdsT >::KvdsKeyIterator | ( | ) | [inline] |
Definition at line 108 of file kvds_key_iterator.hpp.
moost::kvds::KvdsKeyIterator< kvdsT >::KvdsKeyIterator | ( | kvdsT const & | kvds | ) | [inline] |
moost::kvds::KvdsKeyIterator< kvdsT >::KvdsKeyIterator | ( | ikvds_ptr_t | ikvds_ptr | ) | [inline] |
moost::kvds::KvdsKeyIterator< kvdsT >::KvdsKeyIterator | ( | KvdsKeyIterator< kvdsT > const & | rhs | ) | [inline] |
Definition at line 122 of file kvds_key_iterator.hpp.
void moost::kvds::KvdsKeyIterator< kvdsT >::get_next_key | ( | ) | [inline, private] |
Assemble key
Definition at line 72 of file kvds_key_iterator.hpp.
void moost::kvds::KvdsKeyIterator< kvdsT >::init | ( | ) | [inline, private] |
Definition at line 95 of file kvds_key_iterator.hpp.
bool moost::kvds::KvdsKeyIterator< kvdsT >::operator!= | ( | KvdsKeyIterator< kvdsT > const & | rhs | ) | const [inline] |
Definition at line 174 of file kvds_key_iterator.hpp.
key_type const& moost::kvds::KvdsKeyIterator< kvdsT >::operator* | ( | ) | const [inline] |
Definition at line 179 of file kvds_key_iterator.hpp.
KvdsKeyIterator& moost::kvds::KvdsKeyIterator< kvdsT >::operator++ | ( | ) | [inline] |
KvdsKeyIterator moost::kvds::KvdsKeyIterator< kvdsT >::operator++ | ( | int | ) | [inline] |
KvdsKeyIterator& moost::kvds::KvdsKeyIterator< kvdsT >::operator= | ( | KvdsKeyIterator< kvdsT > const & | rhs | ) | [inline] |
Definition at line 127 of file kvds_key_iterator.hpp.
bool moost::kvds::KvdsKeyIterator< kvdsT >::operator== | ( | KvdsKeyIterator< kvdsT > const & | rhs | ) | const [inline] |
Definition at line 167 of file kvds_key_iterator.hpp.
ikvds_ptr_t moost::kvds::KvdsKeyIterator< kvdsT >::ikvds_ptr_ [private] |
Definition at line 194 of file kvds_key_iterator.hpp.
kvds_key_t moost::kvds::KvdsKeyIterator< kvdsT >::key_ [private] |
Definition at line 192 of file kvds_key_iterator.hpp.
key_type moost::kvds::KvdsKeyIterator< kvdsT >::key__ [private] |
Definition at line 191 of file kvds_key_iterator.hpp.
size_t moost::kvds::KvdsKeyIterator< kvdsT >::pos_ [private] |
Definition at line 193 of file kvds_key_iterator.hpp.