|
| | Queue (size_t capacity, WriteBehavior wb=WriteBlock, ReadBehavior rb=ReadBlock) |
| | Constructs a queue with specified capacity and read / write behaviors.
|
| |
| void | push_front (const T &item) |
| | Makes a copy of item and pushes it to the front of the queue.
|
| |
| void | push_front (T &&item) |
| | Moves item to the front of the queue.
|
| |
| void | pop_back (T *pItem) |
| | Pops an element from the back of the queue: moves the element to *pItem.
|
| |
| size_t | size () const |
| | Get queue occupancy.
|
| |
| void | set_capacity (const size_t c) |
| | Change the capacity of the queue.
|
| |
| | Queue (const Queue &)=delete |
| | Deleted copy constructor.
|
| |
| Queue & | operator= (const Queue &)=delete |
| | Deleted copy assignment operator.
|
| |
| | Queue (Queue &&)=delete |
| | Deleted move constructor (class includes mutex)
|
| |
| Queue && | operator= (Queue &&)=delete |
| | Deleted move assignment operator (class includes mutex)
|
| |
template<class T>
class bm::Queue< T >
A utility queueing class made available to all targets. It could be used -for example- to queue packets between an ingress thread and an egress thread. This is a very simple class, which does not implement anything fancy (e.g. rate limiting, priority queueing, fair scheduling, ...) but can be used as a base class to build something more advanced. Queue includes a mutex and is thread-safe.