libmoost
moost::kvds::KvdsKeyIterator< kvdsT > Class Template Reference

*** This class is NOT thread safe *** More...

#include <kvds_key_iterator.hpp>

List of all members.

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)
KvdsKeyIteratoroperator= (KvdsKeyIterator const &rhs)
KvdsKeyIteratoroperator++ ()
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_

Detailed Description

template<typename kvdsT>
class moost::kvds::KvdsKeyIterator< kvdsT >

*** 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.


Member Typedef Documentation

template<typename kvdsT>
typedef kvdsT::key_type moost::kvds::KvdsKeyIterator< kvdsT >::key_type

Definition at line 67 of file kvds_key_iterator.hpp.

template<typename kvdsT>
typedef kvdsT::kvds_key_t moost::kvds::KvdsKeyIterator< kvdsT >::kvds_key_t [private]

Definition at line 70 of file kvds_key_iterator.hpp.


Constructor & Destructor Documentation

template<typename kvdsT>
moost::kvds::KvdsKeyIterator< kvdsT >::KvdsKeyIterator ( ) [inline]

Definition at line 108 of file kvds_key_iterator.hpp.

template<typename kvdsT>
moost::kvds::KvdsKeyIterator< kvdsT >::KvdsKeyIterator ( kvdsT const &  kvds) [inline]

Definition at line 110 of file kvds_key_iterator.hpp.

Here is the call graph for this function:

template<typename kvdsT>
moost::kvds::KvdsKeyIterator< kvdsT >::KvdsKeyIterator ( ikvds_ptr_t  ikvds_ptr) [inline]

Definition at line 116 of file kvds_key_iterator.hpp.

Here is the call graph for this function:

template<typename kvdsT>
moost::kvds::KvdsKeyIterator< kvdsT >::KvdsKeyIterator ( KvdsKeyIterator< kvdsT > const &  rhs) [inline]

Definition at line 122 of file kvds_key_iterator.hpp.


Member Function Documentation

template<typename kvdsT>
void moost::kvds::KvdsKeyIterator< kvdsT >::get_next_key ( ) [inline, private]

Assemble key

Definition at line 72 of file kvds_key_iterator.hpp.

Here is the caller graph for this function:

template<typename kvdsT>
void moost::kvds::KvdsKeyIterator< kvdsT >::init ( ) [inline, private]

Definition at line 95 of file kvds_key_iterator.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename kvdsT>
bool moost::kvds::KvdsKeyIterator< kvdsT >::operator!= ( KvdsKeyIterator< kvdsT > const &  rhs) const [inline]

Definition at line 174 of file kvds_key_iterator.hpp.

template<typename kvdsT>
key_type const& moost::kvds::KvdsKeyIterator< kvdsT >::operator* ( ) const [inline]

Definition at line 179 of file kvds_key_iterator.hpp.

template<typename kvdsT>
KvdsKeyIterator& moost::kvds::KvdsKeyIterator< kvdsT >::operator++ ( ) [inline]

Definition at line 139 of file kvds_key_iterator.hpp.

Here is the call graph for this function:

template<typename kvdsT>
KvdsKeyIterator moost::kvds::KvdsKeyIterator< kvdsT >::operator++ ( int  ) [inline]

Definition at line 152 of file kvds_key_iterator.hpp.

Here is the call graph for this function:

template<typename kvdsT>
KvdsKeyIterator& moost::kvds::KvdsKeyIterator< kvdsT >::operator= ( KvdsKeyIterator< kvdsT > const &  rhs) [inline]

Definition at line 127 of file kvds_key_iterator.hpp.

template<typename kvdsT>
bool moost::kvds::KvdsKeyIterator< kvdsT >::operator== ( KvdsKeyIterator< kvdsT > const &  rhs) const [inline]

Definition at line 167 of file kvds_key_iterator.hpp.


Member Data Documentation

template<typename kvdsT>
ikvds_ptr_t moost::kvds::KvdsKeyIterator< kvdsT >::ikvds_ptr_ [private]

Definition at line 194 of file kvds_key_iterator.hpp.

template<typename kvdsT>
kvds_key_t moost::kvds::KvdsKeyIterator< kvdsT >::key_ [private]

Definition at line 192 of file kvds_key_iterator.hpp.

template<typename kvdsT>
key_type moost::kvds::KvdsKeyIterator< kvdsT >::key__ [private]

Definition at line 191 of file kvds_key_iterator.hpp.

template<typename kvdsT>
size_t moost::kvds::KvdsKeyIterator< kvdsT >::pos_ [private]

Definition at line 193 of file kvds_key_iterator.hpp.


The documentation for this class was generated from the following file: