An abstract class that acts as an interface to underlying network transport layer.
More...
#include <connection_adapter_client.hpp>
|
| void | notifyConnected () |
| | Allows derived class to invoke connection notification to all observers. More...
|
| |
| void | notifyDisconnected () |
| | Allows derived class to invoke disconnect notification to all observers. More...
|
| |
| void | notifyReceive (const vector< char > &data) |
| | Allows derived class to invoke data received notification to all observers. More...
|
| |
An abstract class that acts as an interface to underlying network transport layer.
This class interface provides functionality to connect to server and transmit & receive data.
◆ Parameters
Container type for parameters.
◆ ClientConnectionAdapter()
| kanzi::connect::ClientConnectionAdapter::ClientConnectionAdapter |
( |
| ) |
|
|
inline |
◆ ~ClientConnectionAdapter()
| virtual kanzi::connect::ClientConnectionAdapter::~ClientConnectionAdapter |
( |
| ) |
|
|
inlinevirtual |
◆ addObserver()
| void kanzi::connect::ClientConnectionAdapter::addObserver |
( |
Observer * |
observer | ) |
|
Adds observer to receive notification from this adapter.
- Parameters
-
◆ configure()
| virtual bool kanzi::connect::ClientConnectionAdapter::configure |
( |
const Parameters & |
parameters | ) |
|
|
inlinevirtual |
Allows to configure the adapter with adapter-specific settings (key-value pairs).
- Parameters
-
| parameters | Configuration parameters, as string-based key value pairs. |
- Returns
- True if the adapter was successfully configured, otherwise false.
Reimplemented in kanzi::connect::ClientSocketConnectionAdapter.
◆ connect()
| virtual bool kanzi::connect::ClientConnectionAdapter::connect |
( |
| ) |
|
|
pure virtual |
◆ disconnect()
| virtual void kanzi::connect::ClientConnectionAdapter::disconnect |
( |
| ) |
|
|
pure virtual |
◆ getConfigurationParameterString()
| static string kanzi::connect::ClientConnectionAdapter::getConfigurationParameterString |
( |
const Parameters & |
parameters, |
|
|
const string & |
parameter |
|
) |
| |
|
staticprotected |
Get single single string type configuration parameter. Returns empty string for missing parameter.
◆ getParameter()
| virtual string kanzi::connect::ClientConnectionAdapter::getParameter |
( |
const string & |
parameter | ) |
|
|
virtual |
Adapter can expose it's parameters using key-value pairs.
This function allows to retrieve a parameter value that was used to configure the adapter.
- Parameters
-
| parameter | Key argument for parameter query. |
- Returns
- Value for a given key that represents configuration parameter.
◆ getState()
| virtual string kanzi::connect::ClientConnectionAdapter::getState |
( |
const string & |
parameter | ) |
|
|
pure virtual |
Adapter can expose it's internal state by using key-value pairs.
This function allows to retrieve a state value from adapter for a given key.
- Parameters
-
| parameter | Key argument for state query. |
- Returns
- Value for a given key that represents a state of the given parameter.
Implemented in kanzi::connect::ClientSocketConnectionAdapter.
◆ getType()
| virtual string kanzi::connect::ClientConnectionAdapter::getType |
( |
| ) |
const |
|
pure virtual |
Returns type of the adapter, this needs to be unique for every adapter.
- Returns
- Adapter type as string.
◆ interrupt()
| virtual void kanzi::connect::ClientConnectionAdapter::interrupt |
( |
| ) |
|
|
pure virtual |
◆ notifyConnected()
| void kanzi::connect::ClientConnectionAdapter::notifyConnected |
( |
| ) |
|
|
protected |
Allows derived class to invoke connection notification to all observers.
◆ notifyDisconnected()
| void kanzi::connect::ClientConnectionAdapter::notifyDisconnected |
( |
| ) |
|
|
protected |
Allows derived class to invoke disconnect notification to all observers.
◆ notifyReceive()
| void kanzi::connect::ClientConnectionAdapter::notifyReceive |
( |
const vector< char > & |
data | ) |
|
|
protected |
Allows derived class to invoke data received notification to all observers.
◆ removeObserver()
| void kanzi::connect::ClientConnectionAdapter::removeObserver |
( |
Observer * |
observer | ) |
|
Removes observer from this adapter.
- Parameters
-
◆ send()
| virtual void kanzi::connect::ClientConnectionAdapter::send |
( |
const vector< char > & |
data | ) |
|
|
pure virtual |
Sends data to network.
- Parameters
-
◆ wait()
| virtual int kanzi::connect::ClientConnectionAdapter::wait |
( |
| ) |
|
|
pure virtual |
Starts waiting event(s) from network, can block to preserve CPU.
- Returns
- Must return <0 in case unrecoverable error occured and method should not be called anymore. >= 0 in case processing should continue. In this case returned value is passed to work(..) routine.
Implemented in kanzi::connect::ClientSocketConnectionAdapter.
◆ work()
| virtual void kanzi::connect::ClientConnectionAdapter::work |
( |
int |
status | ) |
|
|
pure virtual |
The documentation for this class was generated from the following file:
- connect/connection/connection_adapter_client.hpp