|
Libosmium
2.6.0
Fast and flexible C++ library for working with OpenStreetMap data
|
#include <queue.hpp>
Public Member Functions | |
| Queue (size_t max_size=0, const std::string &name="") | |
| ~Queue () | |
| void | push (T value) |
| void | shutdown () |
| void | wait_and_pop (T &value) |
| void | wait_and_pop_with_timeout (T &value) |
| bool | try_pop (T &value) |
| bool | empty () const |
| size_t | size () const |
Private Attributes | |
| const size_t | m_max_size |
| const std::string | m_name |
| Name of this queue (for debugging only). More... | |
| std::mutex | m_mutex |
| std::queue< T > | m_queue |
| std::condition_variable | m_data_available |
| Used to signal readers when data is available in the queue. More... | |
| std::atomic< bool > | m_done |
A thread-safe queue.
|
inlineexplicit |
Construct a multithreaded queue.
| max_size | Maximum number of elements in the queue. Set to 0 for an unlimited size. |
| name | Optional name for this queue. (Used for debugging.) |
|
inline |
|
inline |
|
inline |
Push an element onto the queue. If the queue has a max size, this call will block if the queue is full.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
Used to signal readers when data is available in the queue.
|
private |
|
private |
Maximum size of this queue. If the queue is full pushing to the queue will block.
|
mutableprivate |
|
private |
Name of this queue (for debugging only).
|
private |
1.8.11