mavtables
0.2.1
MAVLink router and firewall.
|
#include <ConnectionPool.hpp>
Public Member Functions | |
TEST_VIRTUAL | ~ConnectionPool ()=default |
TEST_VIRTUAL void | add (std::weak_ptr< Connection > connection) |
TEST_VIRTUAL void | remove (const std::weak_ptr< Connection > &connection) |
TEST_VIRTUAL void | send (std::unique_ptr< const Packet > packet) |
A pool of Connection's to send packets out on.
A connection pool stores a reference to all connections that packets can be sent out over.
Definition at line 36 of file ConnectionPool.hpp.
|
default |
void ConnectionPool::add | ( | std::weak_ptr< Connection > | connection | ) |
Add a connection to the pool.
connection | The connection to add to the pool. |
Definition at line 35 of file ConnectionPool.cpp.
void ConnectionPool::remove | ( | const std::weak_ptr< Connection > & | connection | ) |
Remove a connection from the pool.
connection | The connection to remove from the pool. |
Definition at line 46 of file ConnectionPool.cpp.
void ConnectionPool::send | ( | std::unique_ptr< const Packet > | packet | ) |
Send a packet to every connection.
packet | The packet to send to every connection, must not be nullptr. |
std::invalid_argument | if the packet pointer is null. |
Definition at line 61 of file ConnectionPool.cpp.
References Packet::connection(), Logger::level(), Logger::log(), and str().