Stxxl  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Public Attributes | Private Member Functions
stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ > Struct Template Reference

All sorted runs of a sort operation. More...

#include <sorted_runs.h>

Inheritance diagram for stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >:
Inheritance graph
[legend]
Collaboration diagram for stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef TriggerEntryType trigger_entry_type
typedef
trigger_entry_type::block_type 
block_type
typedef block_type::value_type value_type
typedef std::vector
< trigger_entry_type
run_type
typedef std::vector< value_typesmall_run_type
typedef stxxl::external_size_type size_type
typedef std::vector< run_type >
::size_type 
run_index_type
typedef CompareType_ cmp_type

Public Member Functions

 sorted_runs ()
 ~sorted_runs ()
void inc_ref ()
 Increment internal reference counter.
void dec_ref ()
 Decrement internal reference counter. If it hits zero, the object is freed.
void clear ()
 Clear the internal state of the object: release all runs and reset.
void add_run (const run_type &run, size_type run_size)
 Add a new run with given number of elements.
void swap (sorted_runs &b)

Public Attributes

size_type elements
 total number of elements in all runs
std::vector< run_typeruns
 vector of runs (containing vectors of block ids)
std::vector< size_typeruns_sizes
 vector of the number of elements in each individual run
small_run_type small_run
 Small sort optimization:
size_type refs
 reference counter used by counting_ptr<>

Private Member Functions

void deallocate_blocks ()
 Deallocates the blocks which the runs occupy.

Detailed Description

template<typename TriggerEntryType, typename CompareType_>
struct stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >

All sorted runs of a sort operation.

Definition at line 37 of file sorted_runs.h.


Member Typedef Documentation

template<typename TriggerEntryType , typename CompareType_ >
typedef trigger_entry_type::block_type stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >::block_type

Definition at line 40 of file sorted_runs.h.

template<typename TriggerEntryType , typename CompareType_ >
typedef CompareType_ stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >::cmp_type

Definition at line 47 of file sorted_runs.h.

template<typename TriggerEntryType , typename CompareType_ >
typedef std::vector<run_type>::size_type stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >::run_index_type

Definition at line 45 of file sorted_runs.h.

template<typename TriggerEntryType , typename CompareType_ >
typedef std::vector<trigger_entry_type> stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >::run_type

Definition at line 42 of file sorted_runs.h.

template<typename TriggerEntryType , typename CompareType_ >
typedef stxxl::external_size_type stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >::size_type

Definition at line 44 of file sorted_runs.h.

template<typename TriggerEntryType , typename CompareType_ >
typedef std::vector<value_type> stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >::small_run_type

Definition at line 43 of file sorted_runs.h.

template<typename TriggerEntryType , typename CompareType_ >
typedef TriggerEntryType stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >::trigger_entry_type

Definition at line 39 of file sorted_runs.h.

template<typename TriggerEntryType , typename CompareType_ >
typedef block_type::value_type stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >::value_type

Definition at line 41 of file sorted_runs.h.


Constructor & Destructor Documentation

template<typename TriggerEntryType , typename CompareType_ >
stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >::sorted_runs ( ) [inline]

Definition at line 68 of file sorted_runs.h.

template<typename TriggerEntryType , typename CompareType_ >
stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >::~sorted_runs ( ) [inline]

Definition at line 72 of file sorted_runs.h.


Member Function Documentation

template<typename TriggerEntryType , typename CompareType_ >
void stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >::add_run ( const run_type run,
size_type  run_size 
) [inline]

Add a new run with given number of elements.

Definition at line 101 of file sorted_runs.h.

References run_size.

template<typename TriggerEntryType , typename CompareType_ >
void stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >::clear ( ) [inline]

Clear the internal state of the object: release all runs and reset.

Definition at line 90 of file sorted_runs.h.

Referenced by stxxl::stream::runs_creator< use_push< ValueType_ >, CompareType_, BlockSize_, AllocStr_ >::clear().

template<typename TriggerEntryType , typename CompareType_ >
void stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >::deallocate_blocks ( ) [inline, private]

Deallocates the blocks which the runs occupy.

Remarks:
There is no need in calling this method, the blocks are deallocated by the destructor. However, if you wish to reuse the object, then this function can be used to clear its state.

Definition at line 124 of file sorted_runs.h.

References stxxl::block_manager::delete_blocks(), and stxxl::make_bid_iterator().

template<typename TriggerEntryType , typename CompareType_ >
void stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >::dec_ref ( ) [inline]

Decrement internal reference counter. If it hits zero, the object is freed.

Definition at line 84 of file sorted_runs.h.

template<typename TriggerEntryType , typename CompareType_ >
void stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >::inc_ref ( ) [inline]

Increment internal reference counter.

Definition at line 78 of file sorted_runs.h.

template<typename TriggerEntryType , typename CompareType_ >
void stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >::swap ( sorted_runs< TriggerEntryType, CompareType_ > &  b) [inline]

Member Data Documentation

template<typename TriggerEntryType , typename CompareType_ >
size_type stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >::elements

total number of elements in all runs

Definition at line 50 of file sorted_runs.h.

Referenced by stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >::swap().

template<typename TriggerEntryType , typename CompareType_ >
size_type stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >::refs

reference counter used by counting_ptr<>

Definition at line 65 of file sorted_runs.h.

template<typename TriggerEntryType , typename CompareType_ >
std::vector<run_type> stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >::runs

vector of runs (containing vectors of block ids)

Definition at line 53 of file sorted_runs.h.

Referenced by stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >::swap().

template<typename TriggerEntryType , typename CompareType_ >
std::vector<size_type> stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >::runs_sizes

vector of the number of elements in each individual run

Definition at line 56 of file sorted_runs.h.

Referenced by stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >::swap().

template<typename TriggerEntryType , typename CompareType_ >
small_run_type stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >::small_run

Small sort optimization:

Definition at line 62 of file sorted_runs.h.

Referenced by stxxl::stream::sorted_runs< TriggerEntryType, CompareType_ >::swap().


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines