#include <concurrent_container.hpp>
|
using | size_type = typename Container::size_type |
|
using | value_type = T |
|
|
virtual | ~ConcurrentContainer ()=default |
|
void | push (T &&item) |
|
void | pop (T &item) |
|
template<typename R , typename P > |
bool | pop (T &item, std::chrono::duration< R, P > duration) |
|
bool | empty () const |
|
size_type | size () const |
|
|
std::mutex | m_container_mutex |
|
Container | m_container |
|
template<typename T, typename Container>
class fly::detail::ConcurrentContainer< T, Container >
Wrapper around an STL container to provide thread safe access.
- Author
- Timothy Flynn (trfly.nosp@m.nn89.nosp@m.@pm.m.nosp@m.e)
- Version
- July 27, 2016
◆ ~ConcurrentContainer()
template<typename T , typename Container >
◆ empty()
template<typename T , typename Container >
- Returns
- True if the container is empty.
◆ pop() [1/2]
template<typename T , typename Container >
Pop an item from the container. If the container is empty, wait indefinitely for item to be available.
- Parameters
-
item | Location to store the popped item. |
◆ pop() [2/2]
template<typename T , typename Container >
template<typename R , typename P >
Pop an item from the container. If the container is empty, wait (at most) for the specified amount of time for an item to be available.
- Parameters
-
item | Location to store the popped item. |
duration | The amount of time to wait. |
- Returns
- True if an object was popped in the given duration.
◆ pop_internal()
template<typename T , typename Container >
◆ push()
template<typename T , typename Container >
Move an item onto the container.
- Parameters
-
item | Item to push onto the container. |
◆ push_internal()
template<typename T , typename Container >
◆ size()
template<typename T , typename Container >
- Returns
- The number of items in the container.
The documentation for this class was generated from the following file: