Furrent
|
Special queue that allows the extraction of item using custom policies. More...
#include <queue.hpp>
Public Types | |
enum | Error { Error::Empty, Error::PolicyFailure } |
All possible error that can occur. More... | |
using | Result = util::Result< T, Error > |
Custom queue result type. More... | |
using | MutateFn = std::function< bool(T &)> |
Public Member Functions | |
void | insert (T &&item) |
template<typename... Args> | |
void | emplace (Args &&... args) |
Result | extract (const IPolicy< T > &policy) |
void | mutate (MutateFn mutation) |
Mutate the internal list of items. More... | |
std::list< T > & | items () |
int64_t | size () const |
Special queue that allows the extraction of item using custom policies.
T | type of the stored items |
using fur::policy::Queue< T >::MutateFn = std::function<bool(T&)> |
using fur::policy::Queue< T >::Result = util::Result<T, Error> |
Custom queue result type.
|
strong |
void fur::policy::Queue< T >::emplace | ( | Args &&... | args | ) |
Construct and insert a new element
...args | arguments list used in constructor of T |
auto fur::policy::Queue< T >::extract | ( | const IPolicy< T > & | policy | ) |
Tries to extract an element using a policy
policy | custom logic used to select the element |
void fur::policy::Queue< T >::insert | ( | T && | item | ) |
Insert a new element
item | element to be inserted |
std::list< T > & fur::policy::Queue< T >::items |
void fur::policy::Queue< T >::mutate | ( | MutateFn | mutation | ) |
Mutate the internal list of items.
int64_t fur::policy::Queue< T >::size |