A queue for storing log entries with thread-safe operations.
More...
#include <log_queue.h>
|
| LogQueue (uint64_t queueMaxSize) |
|
bool | insert (proto::LogEntry *item) |
| Inserts a log entry into the queue. This method blocks until space is available in the queue. More...
|
|
bool | fetch_all (std::vector< proto::LogEntry * > &refFetchedItems) |
| Fetches all log entries from the queue. This method blocks until there are items available to fetch. More...
|
|
A queue for storing log entries with thread-safe operations.
This class implements a bounded queue that supports thread-safe insertion and fetching of log entries.
◆ LogQueue()
yarilo::LogQueue::LogQueue |
( |
uint64_t |
queueMaxSize | ) |
|
|
inline |
Constructs a LogQueue with a specified maximum size.
- Parameters
-
[in] | queueMaxSize | Maximum size of the log queue. |
◆ fetch_all()
bool yarilo::LogQueue::fetch_all |
( |
std::vector< proto::LogEntry * > & |
refFetchedItems | ) |
|
|
inline |
Fetches all log entries from the queue. This method blocks until there are items available to fetch.
- Parameters
-
[out] | refFetchedItems | Reference to a vector that will store fetched entries. |
- Returns
- True if fetching was successful, false if timed out.
◆ insert()
bool yarilo::LogQueue::insert |
( |
proto::LogEntry * |
item | ) |
|
|
inline |
Inserts a log entry into the queue. This method blocks until space is available in the queue.
- Parameters
-
[in] | item | Pointer to the log entry to be inserted. |
- Returns
- True if the insertion was successful, false if timed out.
The documentation for this class was generated from the following file: