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

Fixed-capacity ring buffer. More...

#include <fixedcapacitybase.hpp>

Public Types

typedef Array_alloc::value_type value_type
 
typedef int size_type
 
typedef Item_alloc allocator_type
 
typedef segment< value_type * > segment_type
 
typedef ringbuffer_ptrx self_type
 

Public Member Functions

 ringbuffer_ptrx ()
 
 ringbuffer_ptrx (const ringbuffer_ptrx &other)
 
 ringbuffer_ptrx (size_type nb, const value_type &val)
 
 ~ringbuffer_ptrx ()
 
int size () const
 
bool full () const
 
bool empty () const
 
void push_front (const value_type &x)
 
void push_back (const value_type &x)
 
value_typefront () const
 
value_typeback () const
 
value_type pop_front ()
 
value_type pop_back ()
 
void frontn (value_type *dst, int nb) const
 
void backn (value_type *dst, int nb) const
 
void pushn_front (const value_type *xs, int nb)
 
void pushn_back (const value_type *xs, int nb)
 
void popn_front (int nb)
 
template<class Body >
void pushn_back (const Body &body, int nb)
 
void popn_back (int nb)
 
void popn_front (value_type *dst, int nb)
 
void popn_back (value_type *dst, int nb)
 
void transfer_from_back_to_front (ringbuffer_ptrx &target, int nb)
 
void transfer_from_front_to_back (ringbuffer_ptrx &target, int nb)
 
value_typeoperator[] (int ix) const
 
value_typeoperator[] (size_t ix) const
 
void clear ()
 
void swap (ringbuffer_ptrx &other)
 
int array_index_of_logical_index (int ix) const
 
segment_type segment_by_index (int ix) const
 
int index_of_pointer (const value_type *p) const
 
template<class Body >
void for_each (const Body &body) const
 
template<class Body >
void for_each_segment (int lo, int hi, const Body &body) const
 

Static Public Attributes

static constexpr int capacity = Array_alloc::capacity - 1
 

Detailed Description

template<class Array_alloc, class Item_alloc = std::allocator<typename Array_alloc::value_type>>
class pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >

Container properties

Warning
The capacity equals Array_alloc::capacity - 1, because the ringbuffer always leaves one cell empty in order to distinguish between the empty and the full container.
Template Parameters
Array_allocType of the allocator object used to define the storage policy of the array that is used by the stack to store the items of the stack.
Item_allocType of the allocator object used to define the storage allocation model. By default, the allocator class template is used, which defines the simplest memory allocation model and is value-independent. Aliased as member type vector::allocator_type.

Definition at line 1132 of file fixedcapacitybase.hpp.

Member Typedef Documentation

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
typedef Item_alloc pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::allocator_type

Definition at line 1287 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
typedef segment<value_type*> pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::segment_type

Definition at line 1288 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
typedef ringbuffer_ptrx pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::self_type

Definition at line 1289 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
typedef int pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::size_type

Definition at line 1286 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
typedef Array_alloc::value_type pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::value_type

Definition at line 1135 of file fixedcapacitybase.hpp.

Constructor & Destructor Documentation

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::ringbuffer_ptrx ( )
inline

Definition at line 1291 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::ringbuffer_ptrx ( const ringbuffer_ptrx< Array_alloc, Item_alloc > &  other)
inline

Definition at line 1297 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::ringbuffer_ptrx ( size_type  nb,
const value_type val 
)
inline

Definition at line 1313 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::~ringbuffer_ptrx ( )
inline

Definition at line 1319 of file fixedcapacitybase.hpp.

Member Function Documentation

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
int pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::array_index_of_logical_index ( int  ix) const
inline

Definition at line 1475 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
value_type& pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::back ( ) const
inline

Definition at line 1357 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
void pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::backn ( value_type dst,
int  nb 
) const
inline

Definition at line 1384 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
void pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::clear ( )
inline

Definition at line 1465 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
bool pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::empty ( ) const
inline

Definition at line 1336 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
template<class Body >
void pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::for_each ( const Body &  body) const
inline

Definition at line 1512 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
template<class Body >
void pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::for_each_segment ( int  lo,
int  hi,
const Body &  body 
) const
inline

Definition at line 1530 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
value_type& pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::front ( ) const
inline

Definition at line 1352 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
void pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::frontn ( value_type dst,
int  nb 
) const
inline

Definition at line 1378 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
bool pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::full ( ) const
inline

Definition at line 1332 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
int pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::index_of_pointer ( const value_type p) const
inline

Definition at line 1494 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
value_type& pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::operator[] ( int  ix) const
inline

Definition at line 1457 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
value_type& pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::operator[] ( size_t  ix) const
inline

Definition at line 1461 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
value_type pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::pop_back ( )
inline

Definition at line 1370 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
value_type pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::pop_front ( )
inline

Definition at line 1362 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
void pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::popn_back ( int  nb)
inline

Definition at line 1420 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
void pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::popn_back ( value_type dst,
int  nb 
)
inline

Definition at line 1432 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
void pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::popn_front ( int  nb)
inline

Definition at line 1405 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
void pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::popn_front ( value_type dst,
int  nb 
)
inline

Definition at line 1427 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
void pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::push_back ( const value_type x)
inline

Definition at line 1346 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
void pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::push_front ( const value_type x)
inline

Definition at line 1340 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
void pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::pushn_back ( const value_type xs,
int  nb 
)
inline

Definition at line 1398 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
template<class Body >
void pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::pushn_back ( const Body &  body,
int  nb 
)
inline

Definition at line 1413 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
void pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::pushn_front ( const value_type xs,
int  nb 
)
inline

Definition at line 1391 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
segment_type pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::segment_by_index ( int  ix) const
inline

Definition at line 1485 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
int pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::size ( ) const
inline

Definition at line 1325 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
void pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::swap ( ringbuffer_ptrx< Array_alloc, Item_alloc > &  other)
inline

Definition at line 1469 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
void pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::transfer_from_back_to_front ( ringbuffer_ptrx< Array_alloc, Item_alloc > &  target,
int  nb 
)
inline

Definition at line 1437 of file fixedcapacitybase.hpp.

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
void pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::transfer_from_front_to_back ( ringbuffer_ptrx< Array_alloc, Item_alloc > &  target,
int  nb 
)
inline

Definition at line 1447 of file fixedcapacitybase.hpp.

Member Data Documentation

template<class Array_alloc , class Item_alloc = std::allocator<typename Array_alloc::value_type>>
constexpr int pasl::data::fixedcapacity::base::ringbuffer_ptrx< Array_alloc, Item_alloc >::capacity = Array_alloc::capacity - 1
static

Definition at line 1136 of file fixedcapacitybase.hpp.


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