chunkedseq
container library for large in-memory data sets
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Types | Public Member Functions | Public Attributes | Protected Types | Static Protected Attributes | Friends | List of all members
pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator > Class Template Reference

#include <chunkedseqbase.hpp>

Classes

class  DummyCachePrinter
 

Public Types

using iterator = Iterator< self_type, config_type >
 
Container-configuration types
using config_type = Configuration
 
using self_type = chunkedseqbase< config_type >
 
using size_type = typename config_type::size_type
 
using difference_type = typename config_type::difference_type
 
using allocator_type = typename config_type::item_allocator_type
 
Item-specific types
using value_type = typename config_type::value_type
 
using reference = value_type &
 
using const_reference = const value_type &
 
using pointer = value_type *
 
using const_pointer = const value_type *
 
using segment_type = typename config_type::segment_type
 
Cached-measure-specific types
using cache_type = chunk_cache_type
 
using measured_type = typename cache_type::measured_type
 
using algebra_type = typename cache_type::algebra_type
 
using measure_type = typename cache_type::measure_type
 

Public Member Functions

 chunkedseqbase (std::initializer_list< value_type > l)
 
Constructors
 chunkedseqbase ()
 Empty container constructor. More...
 
 chunkedseqbase (size_type n, const value_type &val)
 Fill constructor. More...
 
 chunkedseqbase (const self_type &other)
 Copy constructor. More...
 
Capacity
bool empty () const
 Test whether the container is empty. More...
 
size_type size () const
 Returns size. More...
 
Item access
value_type front () const
 Accesses last item. More...
 
value_type back () const
 Accesses first item. More...
 
void backn (value_type *dst, size_type nb) const
 Access last items. More...
 
void frontn (value_type *dst, size_type nb) const
 Access first items. More...
 
template<class Consumer >
void stream_backn (const Consumer &cons, size_type nb) const
 Consume last items. More...
 
template<class Consumer >
void stream_frontn (const Consumer &cons, size_type nb) const
 Consume first items. More...
 
value_type operator[] (size_type n) const
 Access item. More...
 
reference operator[] (size_type n)
 Access item. More...
 
Modifiers
void push_front (const value_type &x)
 Adds item at the beginning. More...
 
void push_back (const value_type &x)
 Adds item at the end. More...
 
value_type pop_front ()
 Deletes first item. More...
 
value_type pop_back ()
 Deletes last item. More...
 
void pushn_back (const_pointer src, size_type nb)
 Adds items at the end. More...
 
void pushn_front (const_pointer src, size_type nb)
 Adds items at the beginning. More...
 
void popn_front (size_type nb)
 Deletes first items. More...
 
void popn_back (size_type nb)
 Deletes last items. More...
 
void popn_back (value_type *dst, size_type nb)
 Deletes first items. More...
 
void popn_front (value_type *dst, size_type nb)
 Deletes last items. More...
 
template<class Producer >
void stream_pushn_back (const Producer &prod, size_type nb)
 Adds items at the end. More...
 
template<class Producer >
void stream_pushn_front (const Producer &prod, size_type nb)
 Adds items at the beginning. More...
 
template<class Consumer , bool should_consume = true>
void stream_popn_back (const Consumer &cons, size_type nb)
 Deletes last items. More...
 
template<class Consumer , bool should_consume = true>
void stream_popn_front (const Consumer &cons, size_type nb)
 Deletes first items. More...
 
void concat (self_type &other)
 Merges with content of another container. More...
 
template<class Pred >
bool split (const Pred &p, reference middle_item, self_type &other)
 
template<class Pred >
void split (const Pred &p, self_type &other)
 
void split (size_type i, self_type &other)
 Split by index. More...
 
void split (iterator position, self_type &other)
 Split by iterator. More...
 
void split_approximate (self_type &other)
 
iterator insert (iterator position, const value_type &val)
 Inserts items. More...
 
iterator erase (iterator first, iterator last)
 Erases items. More...
 
void clear ()
 Clears items. More...
 
void swap (self_type &other)
 Swaps content. More...
 
Cached measurement
measured_type get_cached () const
 Returns cached measurement. More...
 
measure_type get_measure () const
 Returns measurement operator. More...
 
void set_measure (measure_type meas)
 Sets measurement operator. More...
 
void copy_measure_to (self_type &other)
 Copies the measurement operator. More...
 
Debugging routines
template<class ItemPrinter >
void print_chunk (const chunk_type &c) const
 
template<class ItemPrinter , class CachePrinter = DummyCachePrinter>
void print () const
 
void check_size () const
 
void check () const
 
template<class Add_edge , class Process_chunk >
void reveal_internal_structure (const Add_edge &add_edge, const Process_chunk &process_chunk) const
 

Public Attributes

friend iterator
 

Protected Types

using chunk_type = typename Configuration::chunk_type
 
using chunk_search_type = typename Configuration::chunk_search_type
 
using chunk_cache_type = typename Configuration::chunk_cache_type
 
using chunk_measured_type = typename chunk_cache_type::measured_type
 
using chunk_algebra_type = typename chunk_cache_type::algebra_type
 
using chunk_measure_type = typename chunk_cache_type::measure_type
 
using chunk_pointer = chunk_type *
 
using middle_type = typename Configuration::middle_type
 
using middle_cache_type = typename Configuration::middle_cache_type
 
using middle_measured_type = typename middle_cache_type::measured_type
 
using middle_algebra_type = typename middle_cache_type::algebra_type
 
using middle_measure_type = typename middle_cache_type::measure_type
 
using size_access = typename Configuration::size_access
 
using const_self_pointer_type = const chunkedseqbase< Configuration > *
 

Static Protected Attributes

static constexpr int chunk_capacity = Configuration::chunk_capacity
 

Friends

void extras::split_by_index (self_type &c, size_type i, self_type &other)
 

Iterators

iterator begin () const
 Returns iterator to beginning. More...
 
iterator end () const
 Returns iterator to end. More...
 
template<class Body >
void for_each (const Body &f) const
 Visits every item in the container. More...
 
template<class Body >
void for_each (iterator beg, iterator end, const Body &f) const
 Visits every item in a specified range. More...
 
template<class Body >
void for_each_segment (const Body &f) const
 Visits every segment of items in the container. More...
 
template<class Body >
static void for_each_segment (iterator begin, iterator end, const Body &f)
 Visits every segment of items in a specified range. More...
 

Detailed Description

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
class pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >

Template Parameters
Configurationtype of the class from which to access configuration parameters for the container
Iteratortype of the class to represent the iterator

later: explain the following preconditions Assume "Chunk" to implement fixed-capacity circular buffers. Assume "Topchunk_capacity >= 2" and "Recchunk_capacity >= 2". Assume TopItem to have a trivial destructor.

later: study in detail the memory usage behavior of chunkedseq

Examples:
chunkedseq_1.cpp, chunkedseq_2.cpp, chunkedseq_3.cpp, chunkedseq_5.cpp, chunkedseq_6.cpp, chunkedseq_7.cpp, and weighted_split.cpp.

Definition at line 59 of file chunkedseqbase.hpp.

Member Typedef Documentation

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::algebra_type = typename cache_type::algebra_type

Definition at line 112 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::allocator_type = typename config_type::item_allocator_type

Definition at line 91 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::cache_type = chunk_cache_type

Definition at line 110 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::chunk_algebra_type = typename chunk_cache_type::algebra_type
protected

Definition at line 66 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::chunk_cache_type = typename Configuration::chunk_cache_type
protected

Definition at line 64 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::chunk_measure_type = typename chunk_cache_type::measure_type
protected

Definition at line 67 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::chunk_measured_type = typename chunk_cache_type::measured_type
protected

Definition at line 65 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::chunk_pointer = chunk_type*
protected

Definition at line 68 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::chunk_search_type = typename Configuration::chunk_search_type
protected

Definition at line 63 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::chunk_type = typename Configuration::chunk_type
protected

Definition at line 62 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::config_type = Configuration

Definition at line 87 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::const_pointer = const value_type*

Definition at line 102 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::const_reference = const value_type&

Definition at line 100 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::const_self_pointer_type = const chunkedseqbase<Configuration>*
protected

Definition at line 77 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::difference_type = typename config_type::difference_type

Definition at line 90 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::iterator = Iterator<self_type, config_type>

Definition at line 116 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::measure_type = typename cache_type::measure_type

Definition at line 113 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::measured_type = typename cache_type::measured_type

Definition at line 111 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::middle_algebra_type = typename middle_cache_type::algebra_type
protected

Definition at line 73 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::middle_cache_type = typename Configuration::middle_cache_type
protected

Definition at line 71 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::middle_measure_type = typename middle_cache_type::measure_type
protected

Definition at line 74 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::middle_measured_type = typename middle_cache_type::measured_type
protected

Definition at line 72 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::middle_type = typename Configuration::middle_type
protected

Definition at line 70 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::pointer = value_type*

Definition at line 101 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::reference = value_type&

Definition at line 99 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::segment_type = typename config_type::segment_type

Definition at line 103 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::self_type = chunkedseqbase<config_type>

Definition at line 88 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::size_access = typename Configuration::size_access
protected

Definition at line 75 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::size_type = typename config_type::size_type

Definition at line 89 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
using pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::value_type = typename config_type::value_type

Definition at line 98 of file chunkedseqbase.hpp.

Constructor & Destructor Documentation

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::chunkedseqbase ( )
inline

Constructs an empty container, with no items.

Complexity

Constant

Definition at line 485 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::chunkedseqbase ( size_type  n,
const value_type val 
)
inline

Constructs an empty container, with nb items. Each item is a copy of val.

Parameters
nbNumber of items to put in the container
valValue to replicate

Complexity

Linear in nb.

Definition at line 502 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::chunkedseqbase ( const self_type other)
inline

Constructs a container with a copy of each of the elements in other, in the same order.

Parameters
otherContainer from which to copy.

Complexity

Linear in the resulting container size.

Definition at line 524 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::chunkedseqbase ( std::initializer_list< value_type l)
inline

Definition at line 536 of file chunkedseqbase.hpp.

Member Function Documentation

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
value_type pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::back ( ) const
inline

Returns a reference to the first item in the container.

Calling this method on an empty container causes undefined behavior.

Complexity

Amortized constant time (worst case logarithmic time).

Returns
A reference to the first item in the container.

Definition at line 632 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::backn ( value_type dst,
size_type  nb 
) const
inline

Copies the last nb items from the container to the cells in the array dst.

Calling this method when size() < nb causes undefined behavior.

Complexity

Linear in the number of items being copied (i.e., nb).

Definition at line 657 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
iterator pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::begin ( ) const
inline

Returns an iterator pointing to the first element in the container.

Notice that, unlike member front(), which returns a reference to the first element, this function returns a random access iterator pointing to it.

If the container is empty, the returned iterator value shall not be dereferenced.

Returns
An iterator to the beginning of the container.

Complexity

Logarithmic time.

Examples:
chunkedseq_5.cpp, chunkedseq_6.cpp, and chunkedseq_7.cpp.

Definition at line 1428 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::check ( ) const
inline

Definition at line 1669 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::check_size ( ) const
inline

Definition at line 1652 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::clear ( )
inline

Removes all items from the container (which are destroyed), leaving the container with a size of 0.

Complexity

Linear time (destructions).

Definition at line 1366 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::concat ( self_type other)
inline

Removes all items from other, effectively reducing its size to zero.

Adds items removed from other to the back of this container, after its current last item.

Parameters
otherContainer from which to take items.

Complexity

Logarithmic in the size of the smallest of the two containers.

Examples:
chunkedseq_1.cpp, and chunkedseq_5.cpp.

Definition at line 1212 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::copy_measure_to ( self_type other)
inline

Complexity

Constant time.

Definition at line 1611 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
bool pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::empty ( ) const
inline

Returns whether the container is empty ( i.e. whether its size is 0).

Complexity

Constant time.

Examples:
chunkedseq_1.cpp, and chunkedseq_2.cpp.

Definition at line 557 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
iterator pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::end ( ) const
inline

Returns an iterator referring to the past-the-end element in the container.

The past-the-end element is the theoretical element that would follow the last element in the vector. It does not point to any element, and thus shall not be dereferenced.

Because the ranges used by functions of the standard library do not include the element pointed by their closing iterator, this function is often used in combination with begin() to specify a range including all the elements in the container.

If the container is empty, this function returns the same as begin().

Returns
An iterator to the element past the end of the container.

Complexity

Logarithmic time.

Examples:
chunkedseq_5.cpp, chunkedseq_6.cpp, and chunkedseq_7.cpp.

Definition at line 1457 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
iterator pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::erase ( iterator  first,
iterator  last 
)
inline

Removes from the container either a single item (position) or a range of items ([first,last)).

This effectively reduces the container size by the number of elements removed, which are destroyed.

Complexity

Linear in the number of items erased (destructions) and logarithmic in the number of items in the size of the sequence.

Parameters
firstPointer to the first item to erase.
lastPointer to the position one past the last item to erase.

Definition at line 1352 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
template<class Body >
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::for_each ( const Body &  f) const
inline

Applies a given function f to each item in the sequence in the left-to-right order of the sequence.

Parameters
fFunction to apply to each item. The type of this function must be std::function<void(value_type)>.

Complexity

Linear in the size of the container.

Definition at line 1475 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
template<class Body >
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::for_each ( iterator  beg,
iterator  end,
const Body &  f 
) const
inline

Applies a given function f to each item in the range specified by [beg,end).

The function is applied in left-to-right order.

Parameters
fFunction to apply to each item. The type of this function must be std::function<void(value_type)>.
begPointer to the first item to visit
endPointer to the item one past the last item to visit

Complexity

Linear in end-beg.

Definition at line 1503 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
template<class Body >
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::for_each_segment ( const Body &  f) const
inline

Applies a given function f to each segment in the container.

See Segments for a description of the segment type.

Parameters
fFunction to apply to each segment. The type of this function must be std::function<void(segment_type)>.

Complexity

Linear in the number of segments in the container (assuming that f visits each segment in unit time).

Definition at line 1523 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
template<class Body >
static void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::for_each_segment ( iterator  begin,
iterator  end,
const Body &  f 
)
inlinestatic

Applies a given function f to each segment in the range defined by [beg,end).

See Segments for a description of the segment type.

Parameters
fFunction to apply to the segments. The type of this function must be std::function<void(segment_type)>.
begPointer to the first item to visit
endPointer to the item one past the last item to visit

Complexity

Linear in the number of segments in the given range (assuming that f visits each segment in unit time).

Definition at line 1552 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
value_type pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::front ( ) const
inline

Returns a reference to the last item in the container.

Calling this method on an empty container causes undefined behavior.

Complexity

Amortized constant time (worst case logarithmic time).

Returns
A reference to the last item in the container.

Definition at line 604 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::frontn ( value_type dst,
size_type  nb 
) const
inline

Copies the first nb items from the container to the cells in the array dst.

Calling this method when size() < nb causes undefined behavior.

Complexity

Linear in the number of items being copied (i.e., nb).

Definition at line 674 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
measured_type pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::get_cached ( ) const
inline

Complexity

Constant time.

Examples:
weighted_split.cpp.

Definition at line 1570 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
measure_type pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::get_measure ( ) const
inline

Complexity

Constant time.

Definition at line 1588 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
iterator pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::insert ( iterator  position,
const value_type val 
)
inline

The container is extended by inserting new items before the item at the specified position.

This effectively increates the container size by the amount of items inserted.

Insertions at the front or back are slightly more efficient than on other positions.

The parameters determine how many elements are inserted and to which values they are initialized.

Parameters
positionPosition in the container where the new items are inserted
valValue to be copied (or moved) to the inserted items
Returns
An iterator that points to the first of the newly inserted items.

Complexity

Logarithmic time.

Definition at line 1329 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
value_type pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::operator[] ( size_type  n) const
inline

Returns a copy of the element at position n in the vector container.

Returns
The item at the specified position in the container.
Parameters
Positionof an item in the container. Notice that the first item has a position of 0 (not 1). Member type size_type is an unsigned integral type.

Complexity

Logarithmic time.

Definition at line 743 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
reference pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::operator[] ( size_type  n)
inline

Returns a reference to the element at position n in the vector container.

Returns
The item at the specified position in the container.
Parameters
Positionof an item in the container. Notice that the first item has a position of 0 (not 1). Member type size_type is an unsigned integral type.

Complexity

Logarithmic time.

Definition at line 768 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
value_type pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::pop_back ( )
inline

Removes the last item in the container, effectively reducing the container size by one.

Calling this method destroys the removed item.

Calling this method on an empty container causes undefined behavior.

Complexity

Amortized constant (worst case logarithmic).

Returns
A copy of the last item in the container.
Examples:
chunkedseq_1.cpp, chunkedseq_2.cpp, chunkedseq_3.cpp, and chunkedseq_5.cpp.

Definition at line 882 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
value_type pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::pop_front ( )
inline

Removes the first item in the container, effectively reducing the container size by one.

Calling this method destroys the removed item.

Calling this method on an empty container causes undefined behavior.

Complexity

Amortized constant (worst case logarithmic).

Returns
A copy of the first item in the container.
Examples:
chunkedseq_1.cpp, chunkedseq_2.cpp, and chunkedseq_5.cpp.

Definition at line 846 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::popn_back ( size_type  nb)
inline

Removes the last items in the container, effectively reducing the container size by one.

Calling this method destroys the removed items.

The behavior is undefined if nb > size().

Complexity

Linear in number of items to be removed.

Parameters
destinationArray to which the removed values are to be copied (or moved).
nbNumber of items to remove.

Definition at line 976 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::popn_back ( value_type dst,
size_type  nb 
)
inline

Removes the first items in the container, effectively reducing the container size by nb.

Copies the removed items to the array destination.

Calling this method destroys the removed items.

The behavior is undefined if nb > size().

Complexity

Linear in number of items to be removed.

Parameters
destinationArray to which the removed values are to be copied (or moved).
nbNumber of items to remove.

Definition at line 1001 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::popn_front ( size_type  nb)
inline

Removes the first items in the container, effectively reducing the container size by nb.

Calling this method destroys the removed items.

The behavior is undefined if nb > size().

Complexity

Linear in number of items to be removed.

Parameters
nbNumber of items to remove.

Definition at line 953 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::popn_front ( value_type dst,
size_type  nb 
)
inline

Removes the last items in the container, effectively reducing the container size by one.

Calling this method destroys the removed items.

The behavior is undefined if nb > size().

Complexity

Linear in number of items to be removed.

Parameters
destinationArray to which the removed values are to be copied (or moved).
nbNumber of items to remove.

Definition at line 1023 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
template<class ItemPrinter , class CachePrinter = DummyCachePrinter>
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::print ( ) const
inline

Definition at line 1635 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
template<class ItemPrinter >
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::print_chunk ( const chunk_type c) const
inline

Definition at line 1622 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::push_back ( const value_type x)
inline

Adds a new item to the back of the container, after its current last item. The content of x is copied (or moved) to the new item.

Parameters
xValue to be copied (or moved) to the new item.

Complexity

Amortized constant (worst case logarithmic).

Examples:
chunkedseq_1.cpp, chunkedseq_2.cpp, and chunkedseq_5.cpp.

Definition at line 818 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::push_front ( const value_type x)
inline

Adds a new item to the front of the container, before its current first item. The content of x is copied (or moved) to the new item.

Parameters
xValue to be copied (or moved) to the new item.

Complexity

Amortized constant (worst case logarithmic).

Examples:
chunkedseq_1.cpp, chunkedseq_2.cpp, and chunkedseq_5.cpp.

Definition at line 795 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::pushn_back ( const_pointer  src,
size_type  nb 
)
inline

Adds new items from a given array to the back of the container, after its current last item. The content of items is copied (or moved) to the new positions in the container.

Parameters
itemsValues to be copied (or moved) to the container.
nbNumber of items to be inserted.

Complexity

Linear in number of inserted items.

Definition at line 915 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::pushn_front ( const_pointer  src,
size_type  nb 
)
inline

Adds new items to the front of the container, before its current first item. The content of items is copied (or moved) to the new positions in the container.

Parameters
itemsValues to be copied (or moved) to the container.
nbNumber of items to be inserted.

Complexity

Linear in number of inserted items.

Definition at line 933 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
template<class Add_edge , class Process_chunk >
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::reveal_internal_structure ( const Add_edge &  add_edge,
const Process_chunk &  process_chunk 
) const
inline

Definition at line 1690 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::set_measure ( measure_type  meas)
inline

Complexity

Constant time.

Definition at line 1599 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
size_type pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::size ( ) const
inline

Returns the number of items in the container.

Complexity

Constant time.

Examples:
chunkedseq_1.cpp, and chunkedseq_2.cpp.

Definition at line 571 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
template<class Pred >
bool pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::split ( const Pred &  p,
reference  middle_item,
self_type other 
)
inline
Todo:
document
Examples:
chunkedseq_1.cpp, and chunkedseq_5.cpp.

Definition at line 1249 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
template<class Pred >
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::split ( const Pred &  p,
self_type other 
)
inline
Todo:
document

Definition at line 1261 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::split ( size_type  i,
self_type other 
)
inline

The container is erased after and including the item at (zero-based) index i.

The erased items are moved to the other container.

Precondition
The other container is empty.
i >= 0
i < size()

Definition at line 1279 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::split ( iterator  position,
self_type other 
)
inline

The container is erased after and including the item at the specified position.

The erased items are moved to the other container.

Precondition
The other container is empty.

Definition at line 1293 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::split_approximate ( self_type other)
inline

Definition at line 1297 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
template<class Consumer >
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::stream_backn ( const Consumer &  cons,
size_type  nb 
) const
inline

Streams the first nb items from the container to the client-supplied function cons.

Let our container be c = [c_0, c_1, ..., c_n]. Then, the call stream_backn(cons, nb) performs:

  for (size_type i = nb-1; i < n+1; i++)
     cons(c_i);

Calling this method when size() < nb causes undefined behavior.

Complexity

Linear in the number of items being copied (i.e., nb).

Definition at line 698 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
template<class Consumer >
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::stream_frontn ( const Consumer &  cons,
size_type  nb 
) const
inline

Streams the first nb items from the container to the client-supplied function cons.

Let our container be c = [c_0, c_1, ..., c_n]. Then, the call stream_backn(cons, nb) performs:

  for (size_type i = 0; i < nb; i++)
     cons(c_i);

Calling this method when size() < nb causes undefined behavior.

Complexity

Linear in the number of items being copied (i.e., nb).

Definition at line 722 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
template<class Consumer , bool should_consume = true>
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::stream_popn_back ( const Consumer &  cons,
size_type  nb 
)
inline

Removes the last items in the container, effectively reducing the container size by nb.

Let our container be c = [c_0, c_1, ..., c_n]. Then, the call stream_backn(cons, nb) performs:

  for (size_type i = nb-1; i < n+1; i++)
     cons(c_i);

Calling this method destroys the removed items.

The behavior is undefined if nb > size().

Complexity

Linear in number of items to be removed.

Parameters
consFunction to receive items being removed from the container.
nbNumber of items to remove.

Definition at line 1144 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
template<class Consumer , bool should_consume = true>
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::stream_popn_front ( const Consumer &  cons,
size_type  nb 
)
inline

Removes the first items in the container, effectively reducing the container size by nb.

Let our container be c = [c_0, c_1, ..., c_n]. Then, the call stream_backn(cons, nb) performs:

  for (size_type i = 0; i < nb; i++)
     cons(c_i);

Calling this method destroys the removed items.

The behavior is undefined if nb > size().

Complexity

Linear in number of items to be removed.

Parameters
consFunction to receive items being removed from the container.
nbNumber of items to remove.

Definition at line 1183 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
template<class Producer >
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::stream_pushn_back ( const Producer &  prod,
size_type  nb 
)
inline

Adds new items from a given array to the back of the container, after its current last item. The content is generated by applications of the client-supplied function body. The applications initialize the cells in the container in place.

For a container a, new content is generated by applying body(0, a[0]); body(1, a[1]); ... body(n-1, a[n-1]); where n is the size of the container.

Template Parameters
Typeof the loop body class. This class must implement the interface defined by For-each loops .
Parameters
bodyfunction to generate the contents
nbNumber of items to be inserted.

Complexity

Linear in number of inserted items.

Definition at line 1049 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
template<class Producer >
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::stream_pushn_front ( const Producer &  prod,
size_type  nb 
)
inline

Adds new items to the front of the container, before its current first item. The content is generated by applications of the client-supplied function body. The applications initialize the cells in the container in place.

For a container a, new content is generated by applying body(0, a[0]); body(1, a[1]); ... body(n-1, a[n-1]); where n is the size of the container.

Template Parameters
Typeof the loop body class. This class must implement the interface defined by For-each loops .
Parameters
bodyfunction to generate the contents
nbNumber of items to be inserted.

Complexity

Linear in number of inserted items.

Definition at line 1095 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
void pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::swap ( self_type other)
inline

Exchanges the content of the container by the content of x, which is another container of the same type. Sizes may differ.

After the call to this member function, the items in this container are those which were in x before the call, and the elements of x are those which were in this.

Complexity

Constant time.

Parameters
xAnother container container of the same type (i.e., instantiated with the same template parameters) whose content is swapped with that of this container.

Definition at line 1390 of file chunkedseqbase.hpp.

Friends And Related Function Documentation

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
void extras::split_by_index ( self_type c,
size_type  i,
self_type other 
)
friend

Member Data Documentation

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
constexpr int pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::chunk_capacity = Configuration::chunk_capacity
staticprotected

Definition at line 79 of file chunkedseqbase.hpp.

template<class Configuration, template< class Chunkedseq, class Configuration1 > class Iterator = iterator::random_access>
friend pasl::data::chunkedseq::chunkedseqbase< Configuration, Iterator >::iterator

Definition at line 117 of file chunkedseqbase.hpp.


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