Flat-combining deque.
More...
#include <cds/container/fcdeque.h>
|
typedef T | value_type |
| Value type.
|
|
typedef Deque | deque_type |
| Sequential deque class.
|
|
typedef Traits | traits |
| Deque type traits.
|
|
typedef traits::stat | stat |
| Internal statistics type.
|
|
|
| FCDeque () |
| Initializes empty deque object.
|
|
| FCDeque (unsigned int nCompactFactor, unsigned int nCombinePassCount) |
| Initializes empty deque object and gives flat combining parameters. More...
|
|
bool | push_front (value_type const &val) |
| Inserts a new element at the beginning of the deque container. More...
|
|
bool | push_front (value_type &&val) |
| Inserts a new element at the beginning of the deque container (move semantics) More...
|
|
bool | push_back (value_type const &val) |
| Inserts a new element at the end of the deque container. More...
|
|
bool | push_back (value_type &&val) |
| Inserts a new element at the end of the deque container (move semantics) More...
|
|
bool | pop_front (value_type &val) |
| Removes the first element in the deque container. More...
|
|
bool | pop_back (value_type &val) |
| Removes the last element in the deque container. More...
|
|
void | clear () |
| Clears the deque.
|
|
template<typename Func > |
void | apply (Func f) |
| Exclusive access to underlying deque object. More...
|
|
template<typename Func > |
void | apply (Func f) const |
| Exclusive access to underlying deque object. More...
|
|
size_t | size () const |
| Returns the number of elements in the deque. More...
|
|
bool | empty () const |
| Checks if the deque is empty. More...
|
|
stat const & | statistics () const |
| Internal statistics.
|
|
|
static constexpr const bool | c_bEliminationEnabled = traits::enable_elimination |
| true if elimination is enabled
|
|
template<typename T, class Deque = std::deque<T>, typename Traits = fcdeque::traits>
class cds::container::FCDeque< T, Deque, Traits >
Flat-combining deque.
Flat combining sequential deque. The class can be considered as a concurrent FC-based wrapper for std::deque
.
Template parameters:
T
- a value type stored in the deque
Deque
- sequential deque implementation, for example, std::deque<T>
(the default) or boost::container::deque
Trats
- type traits of flat combining, default is fcdeque::traits
. fcdeque::make_traits
metafunction can be used to construct specialized fcdeque::traits
◆ FCDeque()
template<typename T , class Deque = std::deque<T>, typename Traits = fcdeque::traits>
Initializes empty deque object and gives flat combining parameters.
- Parameters
-
nCompactFactor | Flat combining: publication list compacting factor |
nCombinePassCount | Flat combining: number of combining passes for combiner thread |
◆ apply() [1/2]
template<typename T , class Deque = std::deque<T>, typename Traits = fcdeque::traits>
template<typename Func >
Exclusive access to underlying deque object.
The functor f
can do any operation with underlying deque_type
in exclusive mode. For example, you can iterate over the deque. Func
signature is:
◆ apply() [2/2]
template<typename T , class Deque = std::deque<T>, typename Traits = fcdeque::traits>
template<typename Func >
Exclusive access to underlying deque object.
The functor f
can do any operation with underlying deque_type
in exclusive mode. For example, you can iterate over the deque. Func
signature is:
◆ empty()
template<typename T , class Deque = std::deque<T>, typename Traits = fcdeque::traits>
Checks if the deque is empty.
If the combining is in process the function waits while combining done.
◆ pop_back()
template<typename T , class Deque = std::deque<T>, typename Traits = fcdeque::traits>
Removes the last element in the deque container.
The function returns false
if the deque is empty, true
otherwise. If the deque is empty val
is not changed.
- Parameters
-
val | Target to be received the copy of removed element |
◆ pop_front()
template<typename T , class Deque = std::deque<T>, typename Traits = fcdeque::traits>
Removes the first element in the deque container.
The function returns false
if the deque is empty, true
otherwise. If the deque is empty val
is not changed.
- Parameters
-
val | Target to be received the copy of removed element |
◆ push_back() [1/2]
template<typename T , class Deque = std::deque<T>, typename Traits = fcdeque::traits>
Inserts a new element at the end of the deque container.
The function always returns true
- Parameters
-
val | Value to be copied to inserted element |
◆ push_back() [2/2]
template<typename T , class Deque = std::deque<T>, typename Traits = fcdeque::traits>
Inserts a new element at the end of the deque container (move semantics)
The function always returns true
- Parameters
-
val | Value to be moved to inserted element |
◆ push_front() [1/2]
template<typename T , class Deque = std::deque<T>, typename Traits = fcdeque::traits>
Inserts a new element at the beginning of the deque container.
The function always returns true
- Parameters
-
val | Value to be copied to inserted element |
◆ push_front() [2/2]
template<typename T , class Deque = std::deque<T>, typename Traits = fcdeque::traits>
Inserts a new element at the beginning of the deque container (move semantics)
The function always returns true
- Parameters
-
val | Value to be moved to inserted element |
◆ size()
template<typename T , class Deque = std::deque<T>, typename Traits = fcdeque::traits>
Returns the number of elements in the deque.
Note that size() == 0
is not mean that the deque is empty because combining record can be in process. To check emptiness use empty function.
The documentation for this class was generated from the following file: