MIRA
|
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... | |
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.
RemoteConnectionProxy createRemoteOutgoingConnection | ( | const KnownFramework & | address | ) |
Function that constructs a RemoteOutgoingConnection, stores that connection in mRemoteConnections and returns a RemoteConnectionProxy.
address | Connection details of the outgoing connection |
RemoteConnectionProxy createRemoteIncomingConnection | ( | ) |
Function that constructs a RemoteIncomingConnection, stores that connection in mRemoteConnections and returns a RemoteConnectionProxy.
void releaseStoppedConnections | ( | ) |
Clears mStoppedConnections to destroy the RemoteConnection objects.
|
protected |
Moves the ownership for a connection from mRemoteConnections to mStoppedConnections.
Is called in the destructor of RemoteConnectionProxy.
connection | pointer to a RemoteConnection |
|
mutableprotected |
Mutex for access to mRemoteConnections and mStoppedConnections.
|
protected |
Connections for which a RemoteConnectionProxy exists.
|
protected |
Connections for which no RemoteConnectionProxy exists anymore (awaiting deletion).