Storage for Record s.
More...
#include <RecordQueue.hpp>
|
using | Record_t = std::remove_cvref_t< TRecord > |
|
|
void | push (Record_t record) |
| Pushes Record s to the internal queue. More...
|
|
std::optional< Record_t > | take (std::optional< std::chrono::milliseconds > waitingDuration=std::nullopt) |
| Takes the first Record from the queue. More...
|
|
bool | empty () const noexcept |
| Checks if the internal queue is empty. More...
|
|
std::size_t | size () const noexcept |
| Checks size of the internal queue. More...
|
|
template<Record TRecord>
class sl::log::RecordQueue< TRecord >
Storage for Record s.
- Template Parameters
-
This class is a simple representation of a blocking queue. Its take() function blocks until an element is present in the internal queue or the duration exceeded. Each function is thread-safe by design.
◆ Record_t
◆ empty()
Checks if the internal queue is empty.
Thread-safe
- Returns
- Returns true if is empty.
◆ push()
Pushes Record s to the internal queue.
Thread-safe
- Parameters
-
record | The queued Record object. |
◆ size()
Checks size of the internal queue.
Thread-safe
- Returns
- Returns size
◆ take()
Takes the first Record from the queue.
Thread-safe If the internal queue is not empty, this functions takes the first element and returns it. If the queue is empty, this function will block until a new Record gets pushed into the queue or the duration exceeds.
- Parameters
-
waitingDuration | The max waiting duration for an element. |
- Returns
- Returns an element as optional. Might be nullopt.
The documentation for this class was generated from the following file: