STXXL  1.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr > Class Template Reference

Detailed Description

template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
class stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >

External merger, based on the loser tree data structure.

Parameters
Arity_maximum arity of merger, does not need to be a power of 2

Definition at line 127 of file pq_ext_merger.h.

+ Inheritance diagram for stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >:
+ Collaboration diagram for stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >:

Classes

struct  sequence_state
 

Public Types

enum  { arity = Arity, arity_bound = 1UL << (LOG2<Arity>::ceil) }
 
typedef AllocStr alloc_strategy
 
typedef block_type::bid_type bid_type
 
typedef BlockType block_type
 
typedef Cmp comparator_type
 
typedef read_write_pool
< block_type
pool_type
 
typedef stxxl::uint64 size_type
 
typedef block_type::value_type value_type
 

Public Member Functions

 ext_merger ()
 
 ext_merger (pool_type *pool_)
 
virtual ~ext_merger ()
 
template<class Merger >
void insert_segment (Merger &another_merger, size_type segment_size)
 
bool is_space_available () const
 
unsigned_type mem_cons () const
 
template<class OutputIterator >
void multi_merge (OutputIterator begin, OutputIterator end)
 
void set_pool (pool_type *pool_)
 
size_type size () const
 

Protected Member Functions

void deallocate_segment (unsigned_type slot)
 
void insert_segment (std::list< bid_type > *bidlist, block_type *first_block, unsigned_type first_size, unsigned_type slot)
 
bool is_segment_allocated (unsigned_type slot) const
 
bool is_segment_empty (unsigned_type slot) const
 
bool is_sentinel (const value_type &a) const
 
bool not_sentinel (const value_type &a) const
 

Protected Attributes

comparator_type cmp
 
internal_bounded_stack
< unsigned_type, arity
free_segments
 
unsigned_type k
 
unsigned_type log_k
 
pool_typepool
 
block_typesentinel_block
 
size_type size_
 
sequence_state states [arity_bound]
 

Private Member Functions

void compact_tree ()
 
void double_k ()
 
void init ()
 
void rebuild_loser_tree ()
 
- Private Member Functions inherited from stxxl::noncopyable
 noncopyable ()
 

Member Typedef Documentation

template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
typedef AllocStr stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::alloc_strategy

Definition at line 135 of file pq_ext_merger.h.

template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
typedef block_type::bid_type stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::bid_type

Definition at line 132 of file pq_ext_merger.h.

template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
typedef BlockType stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::block_type

Definition at line 131 of file pq_ext_merger.h.

template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
typedef Cmp stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::comparator_type

Definition at line 134 of file pq_ext_merger.h.

template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
typedef read_write_pool<block_type> stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::pool_type

Definition at line 136 of file pq_ext_merger.h.

template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
typedef stxxl::uint64 stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::size_type

Definition at line 130 of file pq_ext_merger.h.

template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
typedef block_type::value_type stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::value_type

Definition at line 133 of file pq_ext_merger.h.

Member Enumeration Documentation

template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
anonymous enum
Enumerator
arity 
arity_bound 

Definition at line 139 of file pq_ext_merger.h.

Constructor & Destructor Documentation

template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::ext_merger ( )
inline

Definition at line 290 of file pq_ext_merger.h.

template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::ext_merger ( pool_type pool_)
inline

Definition at line 296 of file pq_ext_merger.h.

template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
virtual stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::~ext_merger ( )
inlinevirtual

Member Function Documentation

template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
void stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::insert_segment ( std::list< bid_type > *  bidlist,
block_type first_block,
unsigned_type  first_size,
unsigned_type  slot 
)
inlineprotected
template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
bool stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::is_segment_allocated ( unsigned_type  slot) const
inlineprotected
template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
bool stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::is_segment_empty ( unsigned_type  slot) const
inlineprotected

Definition at line 1091 of file pq_ext_merger.h.

template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
bool stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::is_sentinel ( const value_type a) const
inlineprotected

Definition at line 144 of file pq_ext_merger.h.

template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
bool stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::is_space_available ( ) const
inline
template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
unsigned_type stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::mem_cons ( ) const
inline

Definition at line 551 of file pq_ext_merger.h.

template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
bool stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::not_sentinel ( const value_type a) const
inlineprotected

Definition at line 149 of file pq_ext_merger.h.

template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
void stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::rebuild_loser_tree ( )
inlineprivate

Definition at line 357 of file pq_ext_merger.h.

template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
void stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::set_pool ( pool_type pool_)
inline
template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
size_type stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::size ( ) const
inline

Definition at line 1048 of file pq_ext_merger.h.

Member Data Documentation

template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
comparator_type stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::cmp
protected

Definition at line 142 of file pq_ext_merger.h.

template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
internal_bounded_stack<unsigned_type, arity> stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::free_segments
protected

Definition at line 272 of file pq_ext_merger.h.

template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
unsigned_type stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::k
protected

Definition at line 266 of file pq_ext_merger.h.

template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
unsigned_type stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::log_k
protected

Definition at line 265 of file pq_ext_merger.h.

template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
pool_type* stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::pool
protected

Definition at line 285 of file pq_ext_merger.h.

template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
block_type* stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::sentinel_block
protected

Definition at line 287 of file pq_ext_merger.h.

template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
size_type stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::size_
protected

Definition at line 264 of file pq_ext_merger.h.

template<class BlockType, class Cmp, unsigned Arity, class AllocStr = STXXL_DEFAULT_ALLOC_STRATEGY>
sequence_state stxxl::priority_queue_local::ext_merger< BlockType, Cmp, Arity, AllocStr >::states[arity_bound]
protected

Definition at line 283 of file pq_ext_merger.h.


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