Pothos
0.7.0-gf7fbae99
The Pothos dataflow programming software suite
|
#include <RingDeque.hpp>
Public Types | |
typedef T | value_type |
The element type. More... | |
typedef Allocator | allocator_type |
The allocator type. More... | |
Public Member Functions | |
RingDeque (const size_t capacity=1, const Allocator &allocator=Allocator()) | |
RingDeque (const RingDeque< T, Allocator > &other) | |
Copy constructor. More... | |
RingDeque (RingDeque< T, Allocator > &&other) | |
Move constructor. More... | |
RingDeque & | operator= (const RingDeque< T, Allocator > &other) |
Copy assignment. More... | |
RingDeque & | operator= (RingDeque< T, Allocator > &&other) |
Move assignment. More... | |
~RingDeque (void) | |
Destruct the ring queue and any elements held. More... | |
const T & | operator[] (const size_t offset) const |
Get a const ref at, where front == 0, back == size() - 1. More... | |
T & | operator[] (const size_t offset) |
Get a ref at, where front == 0, back == size() - 1. More... | |
template<typename U > | |
void | push_front (U &&elem) |
Push an element onto the front of the queue. More... | |
template<typename... Args> | |
T & | emplace_front (Args &&... args) |
Emplace an element onto the front of the queue. More... | |
void | pop_front (void) |
Pop and element from the front of the queue. More... | |
const T & | front (void) const |
Get a const reference to the front element. More... | |
T & | front (void) |
Get a reference to the front element. More... | |
template<typename U > | |
void | push_back (U &&elem) |
Push an element onto the back of the queue. More... | |
template<typename... Args> | |
T & | emplace_back (Args &&... args) |
Emplace an element onto the back of the queue. More... | |
void | pop_back (void) |
Pop and element from the back of the queue. More... | |
const T & | back (void) const |
Get a const reference to the back element. More... | |
T & | back (void) |
Get a reference to the back element. More... | |
bool | empty (void) const |
Is the deque empty? – no elements. More... | |
bool | full (void) const |
Is the deque full? – num elements == capacity. More... | |
size_t | size (void) const |
How many elements are in the deque. More... | |
size_t | capacity (void) const |
How many elements can be stored? More... | |
void | set_capacity (const size_t capacity) |
Set the deque capacity if too small. More... | |
void | clear (void) |
Empty the contents of this queue. More... | |
RingDeque is a templated deque using an underlying vector. The API of RingDeque is very similar to the std::deque<T>. RingDeque is here because I wanted the efficiency of boost::circular_buffer without the boost requirement. The ring deque does not have a specific capacity limit.
typedef Allocator Pothos::Util::RingDeque< T, Allocator >::allocator_type |
The allocator type.
typedef T Pothos::Util::RingDeque< T, Allocator >::value_type |
The element type.
Pothos::Util::RingDeque< T, A >::RingDeque | ( | const size_t | capacity = 1 , |
const A & | allocator = Allocator() |
||
) |
Construct a new ring deque
capacity | the maximum space available |
allocator | an optional custom allocator |
Pothos::Util::RingDeque< T, A >::RingDeque | ( | const RingDeque< T, A > & | other | ) |
Copy constructor.
Pothos::Util::RingDeque< T, A >::RingDeque | ( | RingDeque< T, A > && | other | ) |
Move constructor.
Pothos::Util::RingDeque< T, A >::~RingDeque | ( | void | ) |
Destruct the ring queue and any elements held.
const T & Pothos::Util::RingDeque< T, A >::back | ( | void | ) | const |
Get a const reference to the back element.
T & Pothos::Util::RingDeque< T, A >::back | ( | void | ) |
Get a reference to the back element.
size_t Pothos::Util::RingDeque< T, A >::capacity | ( | void | ) | const |
How many elements can be stored?
void Pothos::Util::RingDeque< T, A >::clear | ( | void | ) |
Empty the contents of this queue.
T & Pothos::Util::RingDeque< T, A >::emplace_back | ( | Args &&... | args | ) |
Emplace an element onto the back of the queue.
T & Pothos::Util::RingDeque< T, A >::emplace_front | ( | Args &&... | args | ) |
Emplace an element onto the front of the queue.
bool Pothos::Util::RingDeque< T, A >::empty | ( | void | ) | const |
Is the deque empty? – no elements.
const T & Pothos::Util::RingDeque< T, A >::front | ( | void | ) | const |
Get a const reference to the front element.
T & Pothos::Util::RingDeque< T, A >::front | ( | void | ) |
Get a reference to the front element.
bool Pothos::Util::RingDeque< T, A >::full | ( | void | ) | const |
Is the deque full? – num elements == capacity.
RingDeque< T, A > & Pothos::Util::RingDeque< T, A >::operator= | ( | const RingDeque< T, A > & | other | ) |
Copy assignment.
RingDeque< T, A > & Pothos::Util::RingDeque< T, A >::operator= | ( | RingDeque< T, A > && | other | ) |
Move assignment.
const T & Pothos::Util::RingDeque< T, A >::operator[] | ( | const size_t | offset | ) | const |
Get a const ref at, where front == 0, back == size() - 1.
T & Pothos::Util::RingDeque< T, A >::operator[] | ( | const size_t | offset | ) |
Get a ref at, where front == 0, back == size() - 1.
void Pothos::Util::RingDeque< T, A >::pop_back | ( | void | ) |
Pop and element from the back of the queue.
void Pothos::Util::RingDeque< T, A >::pop_front | ( | void | ) |
Pop and element from the front of the queue.
void Pothos::Util::RingDeque< T, A >::push_back | ( | U && | elem | ) |
Push an element onto the back of the queue.
void Pothos::Util::RingDeque< T, A >::push_front | ( | U && | elem | ) |
Push an element onto the front of the queue.
void Pothos::Util::RingDeque< T, A >::set_capacity | ( | const size_t | capacity | ) |
Set the deque capacity if too small.
size_t Pothos::Util::RingDeque< T, A >::size | ( | void | ) | const |
How many elements are in the deque.