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

Detailed Description

template<class CacheType, class BidIterator>
class stxxl::hash_map::buffered_reader< CacheType, BidIterator >

Used to scan external memory with prefetching.

Definition at line 95 of file util.h.

+ Inheritance diagram for stxxl::hash_map::buffered_reader< CacheType, BidIterator >:
+ Collaboration diagram for stxxl::hash_map::buffered_reader< CacheType, BidIterator >:

Public Types

enum  { block_size = block_type::size, subblock_size = subblock_type::size }
 
typedef BidIterator bid_iterator
 
typedef bid_iterator::value_type bid_type
 
typedef cache_type::block_type block_type
 
typedef CacheType cache_type
 
typedef block_type::value_type subblock_type
 
typedef subblock_type::value_type value_type
 

Public Member Functions

 buffered_reader (bid_iterator seq_begin, bid_iterator seq_end, cache_type &cache, internal_size_type i_subblock=0, bool prefetch=true)
 Create a new buffered reader to read the blocks in [seq_begin, seq_end) More...
 
 ~buffered_reader ()
 
const value_typeconst_value ()
 Get const-reference to current value. More...
 
void enable_prefetching ()
 
void next_subblock ()
 Skip remaining values of the current subblock. More...
 
bool operator++ ()
 Advance to the next value. More...
 
void skip_to (bid_iterator bid, internal_size_type i_subblock)
 Continue reading at given block and subblock. More...
 
value_typevalue ()
 Get reference to current value. The current value's block's dirty flag will be set. More...
 

Private Attributes

bid_iterator begin_bid_
 points to the beginning of the block-sequence More...
 
cache_typecache_
 shared block-cache More...
 
bid_iterator curr_bid_
 points to the current block More...
 
bool dirty_
 current block dirty ? More...
 
bid_iterator end_bid_
 points to the end of the block-sequence More...
 
unsigned_type i_value_
 index within current block More...
 
unsigned_type page_size_
 pages, which are read at once from disk, consist of this many blocks More...
 
bid_iterator pref_bid_
 points to the next block to prefetch More...
 
bool prefetch_
 true if prefetching enabled More...
 
unsigned_type prefetch_pages_
 number of pages to prefetch More...
 
subblock_typesubblock_
 current subblock More...
 

Additional Inherited Members

- Private Member Functions inherited from stxxl::noncopyable
 noncopyable ()
 

Member Typedef Documentation

template<class CacheType , class BidIterator >
typedef BidIterator stxxl::hash_map::buffered_reader< CacheType, BidIterator >::bid_iterator

Definition at line 99 of file util.h.

template<class CacheType , class BidIterator >
typedef bid_iterator::value_type stxxl::hash_map::buffered_reader< CacheType, BidIterator >::bid_type

Definition at line 105 of file util.h.

template<class CacheType , class BidIterator >
typedef cache_type::block_type stxxl::hash_map::buffered_reader< CacheType, BidIterator >::block_type

Definition at line 101 of file util.h.

template<class CacheType , class BidIterator >
typedef CacheType stxxl::hash_map::buffered_reader< CacheType, BidIterator >::cache_type

Definition at line 98 of file util.h.

template<class CacheType , class BidIterator >
typedef block_type::value_type stxxl::hash_map::buffered_reader< CacheType, BidIterator >::subblock_type

Definition at line 102 of file util.h.

template<class CacheType , class BidIterator >
typedef subblock_type::value_type stxxl::hash_map::buffered_reader< CacheType, BidIterator >::value_type

Definition at line 103 of file util.h.

Member Enumeration Documentation

template<class CacheType , class BidIterator >
anonymous enum
Enumerator
block_size 
subblock_size 

Definition at line 107 of file util.h.

Constructor & Destructor Documentation

template<class CacheType , class BidIterator >
stxxl::hash_map::buffered_reader< CacheType, BidIterator >::buffered_reader ( bid_iterator  seq_begin,
bid_iterator  seq_end,
cache_type cache,
internal_size_type  i_subblock = 0,
bool  prefetch = true 
)
inline

Create a new buffered reader to read the blocks in [seq_begin, seq_end)

Parameters
seq_beginFirst block's bid
seq_endLast block's bid
cacheBlock-cache used for prefetching
i_subblockStart reading from this subblock
prefetchEnable/Disable prefetching

Definition at line 143 of file util.h.

template<class CacheType , class BidIterator >
stxxl::hash_map::buffered_reader< CacheType, BidIterator >::~buffered_reader ( )
inline

Definition at line 167 of file util.h.

Member Function Documentation

template<class CacheType , class BidIterator >
const value_type& stxxl::hash_map::buffered_reader< CacheType, BidIterator >::const_value ( )
inline

Get const-reference to current value.

Definition at line 192 of file util.h.

template<class CacheType , class BidIterator >
void stxxl::hash_map::buffered_reader< CacheType, BidIterator >::enable_prefetching ( )
inline

Definition at line 173 of file util.h.

template<class CacheType , class BidIterator >
void stxxl::hash_map::buffered_reader< CacheType, BidIterator >::next_subblock ( )
inline

Skip remaining values of the current subblock.

Definition at line 258 of file util.h.

References operator++().

template<class CacheType , class BidIterator >
bool stxxl::hash_map::buffered_reader< CacheType, BidIterator >::operator++ ( )
inline

Advance to the next value.

Returns
false if last value has been reached, otherwise true.

Definition at line 211 of file util.h.

template<class CacheType , class BidIterator >
void stxxl::hash_map::buffered_reader< CacheType, BidIterator >::skip_to ( bid_iterator  bid,
internal_size_type  i_subblock 
)
inline

Continue reading at given block and subblock.

Definition at line 265 of file util.h.

template<class CacheType , class BidIterator >
value_type& stxxl::hash_map::buffered_reader< CacheType, BidIterator >::value ( )
inline

Get reference to current value. The current value's block's dirty flag will be set.

Definition at line 199 of file util.h.

Member Data Documentation

template<class CacheType , class BidIterator >
bid_iterator stxxl::hash_map::buffered_reader< CacheType, BidIterator >::begin_bid_
private

points to the beginning of the block-sequence

Definition at line 113 of file util.h.

template<class CacheType , class BidIterator >
cache_type& stxxl::hash_map::buffered_reader< CacheType, BidIterator >::cache_
private

shared block-cache

Definition at line 122 of file util.h.

template<class CacheType , class BidIterator >
bid_iterator stxxl::hash_map::buffered_reader< CacheType, BidIterator >::curr_bid_
private

points to the current block

Definition at line 115 of file util.h.

template<class CacheType , class BidIterator >
bool stxxl::hash_map::buffered_reader< CacheType, BidIterator >::dirty_
private

current block dirty ?

Definition at line 132 of file util.h.

template<class CacheType , class BidIterator >
bid_iterator stxxl::hash_map::buffered_reader< CacheType, BidIterator >::end_bid_
private

points to the end of the block-sequence

Definition at line 117 of file util.h.

template<class CacheType , class BidIterator >
unsigned_type stxxl::hash_map::buffered_reader< CacheType, BidIterator >::i_value_
private

index within current block

Definition at line 111 of file util.h.

template<class CacheType , class BidIterator >
unsigned_type stxxl::hash_map::buffered_reader< CacheType, BidIterator >::page_size_
private

pages, which are read at once from disk, consist of this many blocks

Definition at line 127 of file util.h.

template<class CacheType , class BidIterator >
bid_iterator stxxl::hash_map::buffered_reader< CacheType, BidIterator >::pref_bid_
private

points to the next block to prefetch

Definition at line 119 of file util.h.

template<class CacheType , class BidIterator >
bool stxxl::hash_map::buffered_reader< CacheType, BidIterator >::prefetch_
private

true if prefetching enabled

Definition at line 125 of file util.h.

template<class CacheType , class BidIterator >
unsigned_type stxxl::hash_map::buffered_reader< CacheType, BidIterator >::prefetch_pages_
private

number of pages to prefetch

Definition at line 129 of file util.h.

template<class CacheType , class BidIterator >
subblock_type* stxxl::hash_map::buffered_reader< CacheType, BidIterator >::subblock_
private

current subblock

Definition at line 134 of file util.h.


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