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. More... | |
Public Types inherited from kanzi::connect::AbstractInterfaceClient | |
| typedef function< void(bool)> | ServiceReachableCallback |
| Callback to inform whether service at server is available or not. More... | |
Public Member Functions | |
| AbstractSessionSharedPtr | acquireSession (MessageDispatcher *dispatcher) |
| Acquire session in to this interface. More... | |
| void | addObserver (AbstractSessionSharedPtr session, ObserverClass *observer) |
| Add observer in to this interface for given session. More... | |
| RPCCallStore & | getCallStore () |
| Retrieve RPC call store that is used to manage pending RPC calls. More... | |
| virtual string | getIdentifier () const |
| Returns the type id of the interface. More... | |
| ObserverClass * | getObserver (AbstractSessionSharedPtr session) |
| Retrieve observer for given session. More... | |
| 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. More... | |
| virtual void | receive (const MessagePackage &message) |
| Pass a message package to this interface, resolves proper session and makes it receive the package. More... | |
| void | releaseSession (AbstractSessionSharedPtr session) |
| Release session that is connected to this interface. More... | |
| void | removeObserver (AbstractSessionSharedPtr session) |
| Remove observer from a given session. More... | |
Public Member Functions inherited from kanzi::connect::AbstractInterfaceClient | |
| AbstractInterfaceClient (RPCCallStore &callStore) | |
| Constructor. More... | |
| AbstractSessionSharedPtr | acquireAbstractSession (MessageDispatcher *dispatcher) |
| Acquires a session for this interface. More... | |
| shared_ptr< p2p::RoutingRules > | getRoutingRules () |
| Retrieve routing rules for this particular client. More... | |
| AbstractSessionSharedPtr | getSession (int sessionId) |
| Returns session by id. More... | |
| bool | isSessionRunning (AbstractSessionSharedPtr session) const |
| Check if the given session is running or not. More... | |
| void | notifyServiceReachable (bool reachable) |
| Invoked to notify clients whether specific service is reachable or not. More... | |
| virtual void | registerRemoteInterface (MessageTranslator *translator) |
| Registers this interface to given message translator. More... | |
| void | releaseAbstractSession (AbstractSessionSharedPtr session) |
| Releases given session from this interface. More... | |
| bool | serviceReachable () const |
| Is service currently known to be reachable. More... | |
| void | setClient (ClientSharedPtr client) |
| Stores the client this interface is bound to. More... | |
| void | setServiceReachableCallback (ServiceReachableCallback callback) |
| Registers service reachable callback. More... | |
| void | setSessionRunning (AbstractSessionSharedPtr session) |
| Set the given session to running state. More... | |
| void | setSessionStopped (AbstractSessionSharedPtr session) |
| Set the given session to stopped state. More... | |
| void | stopAllSessions () |
| Ends all sessions since maybe the service itself has disappeared. More... | |
| void | terminateAllSessions () |
| Terminates all ongoing sessions. More... | |
| virtual | ~AbstractInterfaceClient () |
| Destructor. More... | |
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) |
| Function that allows derived classes to destroy their type-specific session instance. More... | |
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 |