cpp-msgpack-rpc 0.2.0
An RPC library implementing MessagePack RPC.
Loading...
Searching...
No Matches
msgpack_rpc::transport::ConnectionList< Connection > Class Template Reference

Class of lists of connections. More...

#include <msgpack_rpc/transport/connection_list.h>

Inheritance diagram for msgpack_rpc::transport::ConnectionList< Connection >:
Collaboration diagram for msgpack_rpc::transport::ConnectionList< Connection >:

Public Member Functions

 ConnectionList ()=default
 Constructor.
void append (const std::shared_ptr< Connection > &connection)
 Add a connection.
void async_close_all ()
 Asynchronously close all connections.
void remove (Connection *connection)
 Remove a connection.
void remove (const std::shared_ptr< Connection > &connection)
 Remove a connection.

Private Attributes

std::unordered_map< Connection *, std::weak_ptr< Connection > > list_ {}
 List of connections.
std::mutex mutex_ {}
 Mutex.

Detailed Description

template<typename Connection>
class msgpack_rpc::transport::ConnectionList< Connection >

Class of lists of connections.

Template Parameters
ConnectionType of connections.

Definition at line 34 of file connection_list.h.

Member Function Documentation

◆ append()

template<typename Connection>
void msgpack_rpc::transport::ConnectionList< Connection >::append ( const std::shared_ptr< Connection > & connection)
inline

Add a connection.

Parameters
[in]connectionConnection.

Definition at line 46 of file connection_list.h.

◆ async_close_all()

template<typename Connection>
void msgpack_rpc::transport::ConnectionList< Connection >::async_close_all ( )
inline

Asynchronously close all connections.

Definition at line 73 of file connection_list.h.

◆ remove() [1/2]

template<typename Connection>
void msgpack_rpc::transport::ConnectionList< Connection >::remove ( Connection * connection)
inline

Remove a connection.

Parameters
[in]connectionConnection.

Definition at line 65 of file connection_list.h.

◆ remove() [2/2]

template<typename Connection>
void msgpack_rpc::transport::ConnectionList< Connection >::remove ( const std::shared_ptr< Connection > & connection)
inline

Remove a connection.

Parameters
[in]connectionConnection.

Definition at line 56 of file connection_list.h.

Member Data Documentation

◆ list_

template<typename Connection>
std::unordered_map<Connection*, std::weak_ptr<Connection> > msgpack_rpc::transport::ConnectionList< Connection >::list_ {}
private

List of connections.

Definition at line 85 of file connection_list.h.

◆ mutex_

template<typename Connection>
std::mutex msgpack_rpc::transport::ConnectionList< Connection >::mutex_ {}
private

Mutex.

Definition at line 88 of file connection_list.h.


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