AERA
|
#include <tcp_connection.h>
Public Member Functions | |
SafeQueue () | |
SafeQueue (int max_elements) | |
void | enqueue (std::unique_ptr< TCPMessage > t) |
std::unique_ptr< TCPMessage > | dequeue () |
void | clear () |
SafeQueue is a thread-safe queue used to pass data from the TcpIoDevice to the TCPConnection for outgoing and the other way around for incoming messages.
Definition at line 82 of file tcp_connection.h.
|
inline |
Constructor with the name of the queue. Defaults the max number of messages in the queue to 1.
Definition at line 88 of file tcp_connection.h.
|
inline |
Constructor with the name of the queue. Sets the max number of messages in the queue accordingly.
max_elements | The max number of messages in the queue before old messages are deleted if a new one is enqueued. |
Definition at line 99 of file tcp_connection.h.
|
inline |
Clears all entries of the queue.
Definition at line 144 of file tcp_connection.h.
|
inline |
Returns the front element (oldest) of the queue and deletes it.
Definition at line 130 of file tcp_connection.h.
|
inline |
Adds a new element to the queue, also deletes old messages, if the number of messages in the queue is >= max_elements.
t | The message to enqueue. |
Definition at line 113 of file tcp_connection.h.