STXXL  1.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stxxl::stream::sorted_runs< TriggerEntryType, CompareType > Struct Template Reference

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.

+ Inheritance diagram for stxxl::stream::sorted_runs< TriggerEntryType, CompareType >:
+ Collaboration diagram for stxxl::stream::sorted_runs< TriggerEntryType, CompareType >:

Public Types

typedef
trigger_entry_type::block_type 
block_type
 
typedef CompareType cmp_type
 
typedef std::vector< run_type >
::size_type 
run_index_type
 
typedef std::vector
< trigger_entry_type
run_type
 
typedef stxxl::external_size_type size_type
 
typedef std::vector< value_typesmall_run_type
 
typedef TriggerEntryType trigger_entry_type
 
typedef block_type::value_type value_type
 may differ from trigger_entry_type::value_type More...
 

Public Member Functions

 sorted_runs ()
 
 ~sorted_runs ()
 
void add_run (const run_type &run, size_type run_size)
 Add a new run with given number of elements. More...
 
void clear ()
 Clear the internal state of the object: release all runs and reset. More...
 
void swap (sorted_runs &b)
 Swap contents with another object. This is used by the recursive merger to swap in a sorted_runs object with fewer runs. More...
 
- Public Member Functions inherited from stxxl::counted_object
 counted_object ()
 new objects have zero reference count More...
 
 counted_object (const counted_object &)
 coping still creates a new object with zero reference count More...
 
 ~counted_object ()
 
bool dec_reference () const
 Call whenever resetting (i.e. overwriting) a pointer to the object. IMPORTANT: In case of self-assignment, call AFTER inc_reference(). More...
 
unsigned_type get_reference_count () const
 Return the number of references to this object (for debugging) More...
 
void inc_reference () const
 Call whenever setting a pointer to the object. More...
 
counted_objectoperator= (const counted_object &)
 assignment operator, leaves pointers unchanged More...
 
bool unique () const
 Test if the counted_object is referenced by only one counting_ptr. More...
 

Public Attributes

size_type elements
 total number of elements in all runs More...
 
std::vector< run_typeruns
 vector of runs (containing vectors of block ids) More...
 
std::vector< size_typeruns_sizes
 vector of the number of elements in each individual run More...
 
small_run_type small_run
 Small sort optimization: More...
 

Private Member Functions

void deallocate_blocks ()
 Deallocates the blocks which the runs occupy. More...
 
- Private Member Functions inherited from stxxl::noncopyable
 noncopyable ()
 

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 48 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 46 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 43 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 45 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 44 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

may differ from trigger_entry_type::value_type

Definition at line 42 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 66 of file sorted_runs.h.

template<typename TriggerEntryType , typename CompareType >
stxxl::stream::sorted_runs< TriggerEntryType, CompareType >::~sorted_runs ( )
inline

Definition at line 70 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 87 of file sorted_runs.h.

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 76 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 ( )
inlineprivate

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 110 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 >::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 51 of file sorted_runs.h.

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

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 54 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 57 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 63 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: