11template <
class Container,
bool IsConst>
15 using Node =
typename Container::Node;
35 template <
bool OtherIsConst>
86template <
class Container,
bool LhsIsConst,
bool RhsIsConst>
95template <
class Container,
bool LhsIsConst,
bool RhsIsConst>
118template <
class Element,
class Tag =
void>
140 template <
class Container,
bool IsConst>
191 first = (old_head == &
m_end);
215 new_head = node->
m_next.load();
217 return static_cast<Element*
>(node);
pointer operator->() const
reference operator*() const
LockFreeStackIterator & operator++()
typename Container::Node Node
LockFreeStackIterator & operator=(NodePtr node)
typename std::conditional< IsConst, typename Container::const_pointer, typename Container::pointer >::type pointer
LockFreeStackIterator(LockFreeStackIterator< Container, OtherIsConst > const &other)
LockFreeStackIterator(NodePtr node)
typename Container::value_type value_type
typename std::conditional< IsConst, Node const *, Node * >::type NodePtr
typename Container::difference_type difference_type
LockFreeStackIterator operator++(int)
typename std::conditional< IsConst, typename Container::const_reference, typename Container::reference >::type reference
Node(Node const &)=delete
Node & operator=(Node const &)=delete
std::atomic< Node * > m_next
Multiple Producer, Multiple Consumer (MPMC) intrusive stack.
const_iterator cend() const
bool push_front(Node *node)
Push a node onto the stack.
LockFreeStackIterator< LockFreeStack< Element, Tag >, false > iterator
const_iterator cbegin() const
iterator begin()
Return a forward iterator to the beginning or end of the stack.
Element * pop_front()
Pop an element off the stack.
LockFreeStack(LockFreeStack const &)=delete
bool empty() const
Returns true if the stack is empty.
LockFreeStack & operator=(LockFreeStack const &)=delete
Element const * const_pointer
Element const & const_reference
const_iterator begin() const
std::atomic< Node * > m_head
LockFreeStackIterator< LockFreeStack< Element, Tag >, true > const_iterator
const_iterator end() const
bool operator==(LockFreeStackIterator< Container, LhsIsConst > const &lhs, LockFreeStackIterator< Container, RhsIsConst > const &rhs)
bool operator!=(LockFreeStackIterator< Container, LhsIsConst > const &lhs, LockFreeStackIterator< Container, RhsIsConst > const &rhs)