STXXL  1.4-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stxxl::hash_map::hash_map_iterator_base< HashMap > Class Template Reference

Detailed Description

template<class HashMap>
class stxxl::hash_map::hash_map_iterator_base< HashMap >

Definition at line 36 of file iterator.h.

+ Inheritance diagram for stxxl::hash_map::hash_map_iterator_base< HashMap >:
+ Collaboration diagram for stxxl::hash_map::hash_map_iterator_base< HashMap >:

Public Types

typedef
hash_map_type::bid_iterator_type 
bid_iterator_type
 
typedef hash_map_type::bucket_type bucket_type
 
typedef
hash_map_type::const_reference 
const_reference
 
typedef
hash_map_type::external_size_type 
external_size_type
 
typedef HashMap hash_map_type
 
typedef
hash_map_type::internal_size_type 
internal_size_type
 
typedef std::forward_iterator_tag iterator_category
 
typedef hash_map_type::key_type key_type
 
typedef hash_map_type::node_type node_type
 
typedef buffered_reader
< typename
hash_map_type::block_cache_type,
bid_iterator_type
reader_type
 
typedef hash_map_type::reference reference
 
typedef hash_map_type::source_type source_type
 
typedef hash_map_type::value_type value_type
 

Public Member Functions

 hash_map_iterator_base (HashMap *map, internal_size_type i_bucket, node_type *node, external_size_type i_external, source_type source, bool ext_valid, key_type key)
 Construct a new iterator. More...
 
 hash_map_iterator_base (hash_map_type *map)
 Construct a new iterator pointing to the end of the given hash-map. More...
 
 hash_map_iterator_base (const hash_map_iterator_base &obj)
 Construct a new iterator from an existing one. More...
 
virtual ~hash_map_iterator_base ()
 
void find_next (bool start_prefetching=false)
 Advance iterator to the next value The next value is determined in the following way. More...
 
bool operator!= (const hash_map_iterator_base &obj) const
 
hash_map_iterator_baseoperator= (const hash_map_iterator_base &obj)
 Assignment operator. More...
 
bool operator== (const hash_map_iterator_base &obj) const
 Two iterators are equal if the point to the same value in the same map. More...
 

Protected Member Functions

void init_reader ()
 Initialize reader object to scan external values. More...
 
void reset_reader ()
 Reset reader-object. More...
 

Protected Attributes

bool end_
 true if iterator equals end() More...
 
bool ext_valid_
 true if i_external points to the current or next external value More...
 
internal_size_type i_bucket_
 index of current bucket More...
 
external_size_type i_external_
 position of current (source=external) or next (source=internal) external value (see _ext_valid) More...
 
key_type key_
 key of current value More...
 
HashMap * map_
 
node_typenode_
 current (source=internal) or old (src=external) internal node More...
 
bool prefetch_
 true if prefetching enabled; false by default, will be set to true when incrementing (see find_next()) More...
 
reader_typereader_
 
source_type source_
 source of current value: external or internal More...
 

Friends

void HashMap::erase (hash_map_const_iterator< HashMap > it)
 

Member Typedef Documentation

template<class HashMap >
typedef hash_map_type::bid_iterator_type stxxl::hash_map::hash_map_iterator_base< HashMap >::bid_iterator_type

Definition at line 51 of file iterator.h.

template<class HashMap >
typedef hash_map_type::bucket_type stxxl::hash_map::hash_map_iterator_base< HashMap >::bucket_type

Definition at line 50 of file iterator.h.

template<class HashMap >
typedef hash_map_type::const_reference stxxl::hash_map::hash_map_iterator_base< HashMap >::const_reference

Definition at line 48 of file iterator.h.

template<class HashMap >
typedef hash_map_type::external_size_type stxxl::hash_map::hash_map_iterator_base< HashMap >::external_size_type

Definition at line 44 of file iterator.h.

template<class HashMap >
typedef HashMap stxxl::hash_map::hash_map_iterator_base< HashMap >::hash_map_type

Definition at line 42 of file iterator.h.

template<class HashMap >
typedef hash_map_type::internal_size_type stxxl::hash_map::hash_map_iterator_base< HashMap >::internal_size_type

Definition at line 43 of file iterator.h.

template<class HashMap >
typedef std::forward_iterator_tag stxxl::hash_map::hash_map_iterator_base< HashMap >::iterator_category

Definition at line 56 of file iterator.h.

template<class HashMap >
typedef hash_map_type::key_type stxxl::hash_map::hash_map_iterator_base< HashMap >::key_type

Definition at line 46 of file iterator.h.

template<class HashMap >
typedef hash_map_type::node_type stxxl::hash_map::hash_map_iterator_base< HashMap >::node_type

Definition at line 49 of file iterator.h.

template<class HashMap >
typedef buffered_reader<typename hash_map_type::block_cache_type, bid_iterator_type> stxxl::hash_map::hash_map_iterator_base< HashMap >::reader_type

Definition at line 54 of file iterator.h.

template<class HashMap >
typedef hash_map_type::reference stxxl::hash_map::hash_map_iterator_base< HashMap >::reference

Definition at line 47 of file iterator.h.

template<class HashMap >
typedef hash_map_type::source_type stxxl::hash_map::hash_map_iterator_base< HashMap >::source_type

Definition at line 52 of file iterator.h.

template<class HashMap >
typedef hash_map_type::value_type stxxl::hash_map::hash_map_iterator_base< HashMap >::value_type

Definition at line 45 of file iterator.h.

Constructor & Destructor Documentation

template<class HashMap >
stxxl::hash_map::hash_map_iterator_base< HashMap >::hash_map_iterator_base ( HashMap *  map,
internal_size_type  i_bucket,
node_type node,
external_size_type  i_external,
source_type  source,
bool  ext_valid,
key_type  key 
)
inline

Construct a new iterator.

Definition at line 92 of file iterator.h.

References STXXL_VERBOSE3.

template<class HashMap >
stxxl::hash_map::hash_map_iterator_base< HashMap >::hash_map_iterator_base ( hash_map_type map)
inline

Construct a new iterator pointing to the end of the given hash-map.

Definition at line 111 of file iterator.h.

template<class HashMap >
stxxl::hash_map::hash_map_iterator_base< HashMap >::hash_map_iterator_base ( const hash_map_iterator_base< HashMap > &  obj)
inline

Construct a new iterator from an existing one.

Definition at line 124 of file iterator.h.

References STXXL_VERBOSE3.

template<class HashMap >
virtual stxxl::hash_map::hash_map_iterator_base< HashMap >::~hash_map_iterator_base ( )
inlinevirtual

Definition at line 371 of file iterator.h.

References STXXL_VERBOSE3.

Member Function Documentation

template<class HashMap >
void stxxl::hash_map::hash_map_iterator_base< HashMap >::find_next ( bool  start_prefetching = false)
inline

Advance iterator to the next value The next value is determined in the following way.

  • if there are remaining internal or external values in the current bucket, choose the smallest among them, that is not marked as deleted
  • otherwise continue with the next bucket

Definition at line 251 of file iterator.h.

template<class HashMap >
void stxxl::hash_map::hash_map_iterator_base< HashMap >::init_reader ( )
inlineprotected

Initialize reader object to scan external values.

Definition at line 194 of file iterator.h.

References stxxl::hash_map::bucket< NodeType >::i_block_.

template<class HashMap >
bool stxxl::hash_map::hash_map_iterator_base< HashMap >::operator!= ( const hash_map_iterator_base< HashMap > &  obj) const
inline

Definition at line 187 of file iterator.h.

References operator==().

template<class HashMap >
void stxxl::hash_map::hash_map_iterator_base< HashMap >::reset_reader ( )
inlineprotected

Reset reader-object.

Definition at line 237 of file iterator.h.

Friends And Related Function Documentation

template<class HashMap >
void HashMap::erase ( hash_map_const_iterator< HashMap >  it)
friend

Member Data Documentation

template<class HashMap >
bool stxxl::hash_map::hash_map_iterator_base< HashMap >::end_
protected
template<class HashMap >
bool stxxl::hash_map::hash_map_iterator_base< HashMap >::ext_valid_
protected

true if i_external points to the current or next external value

example: iterator was created by hash_map::find() and the value was found in internal memory

=> iterator pointing to internal node is created and location of next external value is unknown (_ext_valid == false)

=> when incrementing the iterator the external values will be scanned from the beginning of the bucket to find the valid external index

Definition at line 86 of file iterator.h.

Referenced by stxxl::hash_map::hash_map_iterator_base< HashMap >::operator=().

template<class HashMap >
external_size_type stxxl::hash_map::hash_map_iterator_base< HashMap >::i_external_
protected

position of current (source=external) or next (source=internal) external value (see _ext_valid)

Definition at line 72 of file iterator.h.

Referenced by stxxl::hash_map::hash_map_iterator_base< HashMap >::operator=(), and stxxl::hash_map::hash_map_iterator_base< HashMap >::operator==().

template<class HashMap >
bool stxxl::hash_map::hash_map_iterator_base< HashMap >::prefetch_
protected

true if prefetching enabled; false by default, will be set to true when incrementing (see find_next())

Definition at line 63 of file iterator.h.

Referenced by stxxl::hash_map::hash_map_iterator_base< HashMap >::operator=().

template<class HashMap >
reader_type* stxxl::hash_map::hash_map_iterator_base< HashMap >::reader_
protected

Definition at line 60 of file iterator.h.


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