mavtables  0.2.1
MAVLink router and firewall.
Public Member Functions | List of all members
ConnectionPool Class Reference

#include <ConnectionPool.hpp>

Collaboration diagram for ConnectionPool:
Collaboration graph

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)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~ConnectionPool()

TEST_VIRTUAL ConnectionPool::~ConnectionPool ( )
default

Member Function Documentation

◆ add()

void ConnectionPool::add ( std::weak_ptr< Connection connection)

Add a connection to the pool.

Parameters
connectionThe connection to add to the pool.

Definition at line 35 of file ConnectionPool.cpp.

Here is the caller graph for this function:

◆ remove()

void ConnectionPool::remove ( const std::weak_ptr< Connection > &  connection)

Remove a connection from the pool.

Parameters
connectionThe connection to remove from the pool.

Definition at line 46 of file ConnectionPool.cpp.

Here is the caller graph for this function:

◆ send()

void ConnectionPool::send ( std::unique_ptr< const Packet packet)

Send a packet to every connection.

Note
Each connection may decide to ignore the packet based on it's filter rules.
Parameters
packetThe packet to send to every connection, must not be nullptr.
Exceptions
std::invalid_argumentif the packet pointer is null.

Definition at line 61 of file ConnectionPool.cpp.

References Packet::connection(), Logger::level(), Logger::log(), and str().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: