MIRA
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
RemoteConnectionPool Class Reference

Owner of every RemoteConnection. More...

#include <fw/RemoteConnectionPool.h>

Public Member Functions

RemoteConnectionProxy createRemoteOutgoingConnection (const KnownFramework &address)
 Function that constructs a RemoteOutgoingConnection, stores that connection in mRemoteConnections and returns a RemoteConnectionProxy. More...
 
RemoteConnectionProxy createRemoteIncomingConnection ()
 Function that constructs a RemoteIncomingConnection, stores that connection in mRemoteConnections and returns a RemoteConnectionProxy. More...
 
void releaseStoppedConnections ()
 Clears mStoppedConnections to destroy the RemoteConnection objects. More...
 

Protected Member Functions

void stopConnection (RemoteConnection *connection)
 Moves the ownership for a connection from mRemoteConnections to mStoppedConnections. More...
 

Protected Attributes

boost::recursive_mutex mConnectionsMutex
 Mutex for access to mRemoteConnections and mStoppedConnections. More...
 
std::set< RemoteConnection * > mRemoteConnections
 Connections for which a RemoteConnectionProxy exists. More...
 
std::vector< std::unique_ptr< RemoteConnection > > mStoppedConnections
 Connections for which no RemoteConnectionProxy exists anymore (awaiting deletion). More...
 

Detailed Description

Owner of every RemoteConnection.

It holds 2 connection maps. The functions RemoteConnectionProxy::createRemoteOutgoingConnection and RemoteConnectionProxy::createRemoteIncomingConnection construct a RemoteConnection, store it in RemoteConnectionPool::mRemoteConnections and return a RemoteConnectionProxy object for that connection. If the proxy object is destroyed, the connection is moved to RemoteConnectionPool::mStoppedConnections. From there, the connection can be destroyed by releaseStoppedConnections. This is called in RemoteModule::process.

Member Function Documentation

◆ createRemoteOutgoingConnection()

RemoteConnectionProxy createRemoteOutgoingConnection ( const KnownFramework address)

Function that constructs a RemoteOutgoingConnection, stores that connection in mRemoteConnections and returns a RemoteConnectionProxy.

Parameters
addressConnection details of the outgoing connection
Returns
proxy for the constructed RemoteConnection

◆ createRemoteIncomingConnection()

RemoteConnectionProxy createRemoteIncomingConnection ( )

Function that constructs a RemoteIncomingConnection, stores that connection in mRemoteConnections and returns a RemoteConnectionProxy.

Returns
proxy for the constructed RemoteConnection

◆ releaseStoppedConnections()

void releaseStoppedConnections ( )

Clears mStoppedConnections to destroy the RemoteConnection objects.

◆ stopConnection()

void stopConnection ( RemoteConnection connection)
protected

Moves the ownership for a connection from mRemoteConnections to mStoppedConnections.

Is called in the destructor of RemoteConnectionProxy.

Parameters
connectionpointer to a RemoteConnection

Member Data Documentation

◆ mConnectionsMutex

boost::recursive_mutex mConnectionsMutex
mutableprotected

Mutex for access to mRemoteConnections and mStoppedConnections.

◆ mRemoteConnections

std::set<RemoteConnection*> mRemoteConnections
protected

Connections for which a RemoteConnectionProxy exists.

◆ mStoppedConnections

std::vector<std::unique_ptr<RemoteConnection> > mStoppedConnections
protected

Connections for which no RemoteConnectionProxy exists anymore (awaiting deletion).


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