RobWorkProject  24.5.15-
Public Member Functions | List of all members
ThreadSafeStack< T > Class Template Reference

Concurrent queue of WorkPiles. More...

#include <ThreadSafeStack.hpp>

Public Member Functions

bool empty ()
 Check if stack is empty. More...
 
void push (T wp)
 Push a new element to the stack. More...
 
bool try_pop (T *wp)
 Pop element from stack, if there is any. More...
 
bool pop (T *wp)
 Pop element from stack. If empty, wait for an element to be pushed. More...
 
bool has (T value)
 Check if given value is in stack. More...
 
size_t size ()
 Get size of stack. More...
 

Detailed Description

template<class T>
class rw::common::ThreadSafeStack< T >

Concurrent queue of WorkPiles.

Member Function Documentation

◆ empty()

bool empty ( )
inline

Check if stack is empty.

Returns
true if empty.

◆ has()

bool has ( value)
inline

Check if given value is in stack.

Parameters
value[in] the value to look for.
Returns
true if found, false otherwise.

◆ pop()

bool pop ( T *  wp)
inline

Pop element from stack. If empty, wait for an element to be pushed.

Parameters
wp[out] the element.
Returns
true.

◆ push()

void push ( wp)
inline

Push a new element to the stack.

Parameters
wp[in] the element to add to stack.

◆ size()

size_t size ( )
inline

Get size of stack.

Returns
the current size.

◆ try_pop()

bool try_pop ( T *  wp)
inline

Pop element from stack, if there is any.

Parameters
wp[out] the element.
Returns
true.

The documentation for this class was generated from the following file: