Templated abstract base class for network interfaces. More...
#include <abstract_interface_client.hpp>
Public Types | |
| typedef map< AbstractSessionSharedPtr, ObserverClass * > | ObserverContainer |
| Type definition for observer container. | |
Public Types inherited from kanzi::connect::AbstractInterfaceClient | |
| typedef function< void(bool)> | ServiceReachableCallback |
| Callback to inform whether service at server is available or not. | |
Public Member Functions | |
| AbstractSessionSharedPtr | acquireSession (MessageDispatcher *dispatcher) |
| Acquire session in to this interface. | |
| void | addObserver (AbstractSessionSharedPtr session, ObserverClass *observer) |
| Add observer in to this interface for given session. | |
| RPCCallStore & | getCallStore () |
| Retrieve RPC call store that is used to manage pending RPC calls. | |
| virtual string | getIdentifier () const |
| Returns the type id of the interface. | |
| ObserverClass * | getObserver (AbstractSessionSharedPtr session) |
| Retrieve observer for given session. | |
| InterfaceClient (const string &identifier, RPCCallStore &callstore) | |
| virtual AbstractSessionSharedPtr | onAcquireSession (int sessionId, MessageDispatcher *dispatcher) |
| Function that allows derived classes to create their type-specific session instance. | |
| virtual void | receive (const MessagePackage &message) |
| Pass a message package to this interface, resolves proper session and makes it receive the package. | |
| void | releaseSession (AbstractSessionSharedPtr session) |
| Release session that is connected to this interface. | |
| void | removeObserver (AbstractSessionSharedPtr session) |
| Remove observer from a given session. | |
Public Member Functions inherited from kanzi::connect::AbstractInterfaceClient | |
| AbstractInterfaceClient (RPCCallStore &callStore) | |
| Constructor. | |
| AbstractSessionSharedPtr | acquireAbstractSession (MessageDispatcher *dispatcher) |
| Acquires a session for this interface. | |
| shared_ptr< p2p::RoutingRules > | getRoutingRules () |
| Retrieve routing rules for this particular client. | |
| AbstractSessionSharedPtr | getSession (int sessionId) |
| Returns session by id. | |
| bool | isSessionRunning (AbstractSessionSharedPtr session) const |
| Check if the given session is running or not. | |
| void | notifyServiceReachable (bool reachable) |
| Invoked to notify clients whether specific service is reachable or not. | |
| virtual void | registerRemoteInterface (MessageTranslator *translator) |
| Registers this interface to given message translator. | |
| void | releaseAbstractSession (AbstractSessionSharedPtr session) |
| Releases given session from this interface. | |
| bool | serviceReachable () const |
| Is service currently known to be reachable. | |
| void | setClient (ClientSharedPtr client) |
| Stores the client this interface is bound to. | |
| void | setServiceReachableCallback (ServiceReachableCallback callback) |
| Registers service reachable callback. | |
| void | setSessionRunning (AbstractSessionSharedPtr session) |
| Set the given session to running state. | |
| void | setSessionStopped (AbstractSessionSharedPtr session) |
| Set the given session to stopped state. | |
| void | stopAllSessions () |
| Ends all sessions since maybe the service itself has disappeared. | |
| void | terminateAllSessions () |
| Terminates all ongoing sessions. | |
| virtual | ~AbstractInterfaceClient () |
| Destructor. | |
Protected Attributes | |
| string | m_identifier |
Protected Attributes inherited from kanzi::connect::AbstractInterfaceClient | |
| RPCCallStore & | m_callStore |
Additional Inherited Members | |
Protected Member Functions inherited from kanzi::connect::AbstractInterfaceClient | |
| virtual void | onReleaseSession (AbstractSessionSharedPtr session) |
| Function that allows derived classes to destroy their type-specific session instance. | |
Templated abstract base class for network interfaces.
Enforces type safety in interface and implements support for observers.
| typedef map<AbstractSessionSharedPtr, ObserverClass*> kanzi::connect::InterfaceClient< ObserverClass, SessionClass >::ObserverContainer |
Type definition for observer container.
|
inline |
|
inline |
Acquire session in to this interface.
| dispatcher | Message dispatcher that is used to deliver network messages. |
|
inline |
Add observer in to this interface for given session.
| session | Session to observe. |
| observer | Observer to receive notifications. |
|
inline |
Retrieve RPC call store that is used to manage pending RPC calls.
|
inlinevirtual |
Returns the type id of the interface.
This is used to identify the service in the network.
Implements kanzi::connect::AbstractInterfaceClient.
|
inline |
Retrieve observer for given session.
| session | Session being observed. |
|
inlinevirtual |
Function that allows derived classes to create their type-specific session instance.
| sessionId | Session Id of the connected client, needs to be unique for this client. |
| dispatcher | Message dispatcher that is used to deliver network messages. |
Implements kanzi::connect::AbstractInterfaceClient.
|
inlinevirtual |
Pass a message package to this interface, resolves proper session and makes it receive the package.
| message | Message that was sent. |
Reimplemented from kanzi::connect::AbstractInterfaceClient.
|
inline |
Release session that is connected to this interface.
| session | Session to release. |
|
inline |
Remove observer from a given session.
| session | Session to remove observer from. |
|
protected |