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

Detailed Description

template<class ValueType>
class stxxl::ppq_local::ppq_iterator< ValueType >

A random-access iterator class for block oriented data.

The iterator is intended to be provided by the internal_array and external_array classes and to be used by the multiway_merge algorithm as input iterators.

Template Parameters
ValueTypethe value type

Definition at line 70 of file parallel_priority_queue.h.

Public Types

typedef std::vector< std::pair
< pointer, pointer > > 
block_pointers_type
 
typedef ptrdiff_t difference_type
 
typedef
std::random_access_iterator_tag 
iterator_category
 
typedef value_typepointer
 
typedef value_typereference
 
typedef ValueType value_type
 

Public Member Functions

 ppq_iterator ()
 default constructor (should not be used directly) More...
 
 ppq_iterator (const block_pointers_type *block_pointers, size_t block_items, size_t index)
 constructor More...
 
size_t get_index () const
 returns the value's index in the internal or external array More...
 
bool operator!= (const self_type &o) const
 
reference operator* () const
 
self_type operator+ (difference_type addend) const
 
self_typeoperator++ ()
 prefix-increment operator More...
 
self_typeoperator+= (difference_type addend)
 
self_type operator- (difference_type subtrahend) const
 
difference_type operator- (const self_type &o) const
 
self_typeoperator-- ()
 prefix-decrement operator More...
 
self_typeoperator-= (difference_type subtrahend)
 
pointer operator-> () const
 
bool operator< (const self_type &o) const
 
bool operator<= (const self_type &o) const
 
bool operator== (const self_type &o) const
 
bool operator> (const self_type &o) const
 
bool operator>= (const self_type &o) const
 
reference operator[] (difference_type relative_index) const
 

Protected Types

typedef ppq_iterator self_type
 

Protected Attributes

size_t m_block_index
 index of the current element's block More...
 
size_t m_block_items
 size of each data block More...
 
const block_pointers_typem_block_pointers
 pointer to a vector of begin/end pointer pairs They allow access to the data blocks. More...
 
pointer m_current
 pointer to the current element More...
 
size_t m_index
 index of the current element More...
 

Private Member Functions

void update ()
 updates m_block_index and m_current based on m_index More...
 

Friends

std::ostream & operator<< (std::ostream &os, const ppq_iterator &i)
 

Member Typedef Documentation

template<class ValueType >
typedef std::vector<std::pair<pointer, pointer> > stxxl::ppq_local::ppq_iterator< ValueType >::block_pointers_type

Definition at line 78 of file parallel_priority_queue.h.

template<class ValueType >
typedef ptrdiff_t stxxl::ppq_local::ppq_iterator< ValueType >::difference_type

Definition at line 76 of file parallel_priority_queue.h.

template<class ValueType >
typedef std::random_access_iterator_tag stxxl::ppq_local::ppq_iterator< ValueType >::iterator_category

Definition at line 77 of file parallel_priority_queue.h.

template<class ValueType >
typedef value_type* stxxl::ppq_local::ppq_iterator< ValueType >::pointer

Definition at line 75 of file parallel_priority_queue.h.

template<class ValueType >
typedef value_type& stxxl::ppq_local::ppq_iterator< ValueType >::reference

Definition at line 74 of file parallel_priority_queue.h.

template<class ValueType >
typedef ppq_iterator stxxl::ppq_local::ppq_iterator< ValueType >::self_type
protected

Definition at line 81 of file parallel_priority_queue.h.

template<class ValueType >
typedef ValueType stxxl::ppq_local::ppq_iterator< ValueType >::value_type

Definition at line 73 of file parallel_priority_queue.h.

Constructor & Destructor Documentation

template<class ValueType >
stxxl::ppq_local::ppq_iterator< ValueType >::ppq_iterator ( )
inline

default constructor (should not be used directly)

Definition at line 101 of file parallel_priority_queue.h.

template<class ValueType >
stxxl::ppq_local::ppq_iterator< ValueType >::ppq_iterator ( const block_pointers_type block_pointers,
size_t  block_items,
size_t  index 
)
inline

constructor

Parameters
block_pointersA reference to the properly initialized vector of begin and end pointers. One pair for each block. The pointers should be valid for all blocks that are expected to be accessed with this iterator.
block_itemsThe size of a single block. If there is only one block (e.g. if the iterator belongs to an internal_array), use the total size here.
indexThe index of the current element (global - index 0 belongs to the first element in the first block, no matter if the values are still valid)

Definition at line 114 of file parallel_priority_queue.h.

Member Function Documentation

template<class ValueType >
size_t stxxl::ppq_local::ppq_iterator< ValueType >::get_index ( ) const
inline

returns the value's index in the internal or external array

Definition at line 124 of file parallel_priority_queue.h.

template<class ValueType >
bool stxxl::ppq_local::ppq_iterator< ValueType >::operator!= ( const self_type o) const
inline
template<class ValueType >
reference stxxl::ppq_local::ppq_iterator< ValueType >::operator* ( ) const
inline

Definition at line 129 of file parallel_priority_queue.h.

template<class ValueType >
self_type stxxl::ppq_local::ppq_iterator< ValueType >::operator+ ( difference_type  addend) const
inline

Definition at line 193 of file parallel_priority_queue.h.

template<class ValueType >
self_type& stxxl::ppq_local::ppq_iterator< ValueType >::operator++ ( )
inline

prefix-increment operator

Definition at line 155 of file parallel_priority_queue.h.

References UNLIKELY.

template<class ValueType >
self_type& stxxl::ppq_local::ppq_iterator< ValueType >::operator+= ( difference_type  addend)
inline

Definition at line 197 of file parallel_priority_queue.h.

template<class ValueType >
self_type stxxl::ppq_local::ppq_iterator< ValueType >::operator- ( difference_type  subtrahend) const
inline

Definition at line 203 of file parallel_priority_queue.h.

template<class ValueType >
difference_type stxxl::ppq_local::ppq_iterator< ValueType >::operator- ( const self_type o) const
inline
template<class ValueType >
self_type& stxxl::ppq_local::ppq_iterator< ValueType >::operator-- ( )
inline

prefix-decrement operator

Definition at line 174 of file parallel_priority_queue.h.

template<class ValueType >
self_type& stxxl::ppq_local::ppq_iterator< ValueType >::operator-= ( difference_type  subtrahend)
inline

Definition at line 211 of file parallel_priority_queue.h.

template<class ValueType >
pointer stxxl::ppq_local::ppq_iterator< ValueType >::operator-> ( ) const
inline

Definition at line 135 of file parallel_priority_queue.h.

template<class ValueType >
bool stxxl::ppq_local::ppq_iterator< ValueType >::operator< ( const self_type o) const
inline
template<class ValueType >
bool stxxl::ppq_local::ppq_iterator< ValueType >::operator<= ( const self_type o) const
inline
template<class ValueType >
bool stxxl::ppq_local::ppq_iterator< ValueType >::operator== ( const self_type o) const
inline
template<class ValueType >
bool stxxl::ppq_local::ppq_iterator< ValueType >::operator> ( const self_type o) const
inline
template<class ValueType >
bool stxxl::ppq_local::ppq_iterator< ValueType >::operator>= ( const self_type o) const
inline
template<class ValueType >
reference stxxl::ppq_local::ppq_iterator< ValueType >::operator[] ( difference_type  relative_index) const
inline

Definition at line 140 of file parallel_priority_queue.h.

template<class ValueType >
void stxxl::ppq_local::ppq_iterator< ValueType >::update ( )
inlineprivate

updates m_block_index and m_current based on m_index

Definition at line 249 of file parallel_priority_queue.h.

Friends And Related Function Documentation

template<class ValueType >
std::ostream& operator<< ( std::ostream &  os,
const ppq_iterator< ValueType > &  i 
)
friend

Definition at line 242 of file parallel_priority_queue.h.

Member Data Documentation

template<class ValueType >
size_t stxxl::ppq_local::ppq_iterator< ValueType >::m_block_index
protected

index of the current element's block

Definition at line 94 of file parallel_priority_queue.h.

template<class ValueType >
size_t stxxl::ppq_local::ppq_iterator< ValueType >::m_block_items
protected

size of each data block

Definition at line 97 of file parallel_priority_queue.h.

template<class ValueType >
const block_pointers_type* stxxl::ppq_local::ppq_iterator< ValueType >::m_block_pointers
protected

pointer to a vector of begin/end pointer pairs They allow access to the data blocks.

Definition at line 85 of file parallel_priority_queue.h.

template<class ValueType >
pointer stxxl::ppq_local::ppq_iterator< ValueType >::m_current
protected

pointer to the current element

Definition at line 88 of file parallel_priority_queue.h.


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