ddt
0.1
|
#include <ddtDataTransferLib.hpp>
Public Member Functions | |
DdtDataTransferLib (DdtLogger *ddt_logger) | |
DdtDataTransferLib (log4cplus::Logger const &log4cplusLogger) | |
virtual | ~DdtDataTransferLib () |
void | SetQoS (const int ddt_latency, const int ddt_deadline) |
virtual int | RegisterPublisher (const std::string uri, const std::string dsi, const bool compute_crc) |
virtual int | UnregisterPublisher () |
virtual void | PublishData () |
virtual int | RegisterSubscriber (const std::string uri, const std::string dsi, const std::string remote_uri, const int32_t interval=10) |
virtual int | UnregisterSubscriber () |
virtual DataSample * | ReadData () |
Protected Member Functions | |
void | StartHeartbeat (const int32_t interval, const std::string id) |
void | StopHeartbeat () |
int | InitMAL (const std::string broker_uri) |
void | CheckHeartbeatTimeout (int32_t &new_reply_time) |
const std::string | VerifyPathInBrokerUri (std::string broker_uri) |
const std::string | GetConfigFilePath () |
Protected Attributes | |
int | latency |
int | deadline |
int32_t | reply_time |
int32_t | heartbeat_interval |
std::promise< void > | exit_signal_heartbeat |
std::future< void > | future_object_heartbeat |
std::atomic< bool > | heartbeat_active |
std::unique_ptr< datatransfer::DataBrokerRegistrationSync, std::default_delete< datatransfer::DataBrokerRegistrationSync > > | client |
std::atomic< bool > | connected_to_broker |
elt::mal::rr::ListenerRegistration | connection_listener |
DdtLogger * | logger |
DdtLogger * | myLogger = nullptr |
const int32_t | REPLY_TIME_DEFAULT = 6 |
const int32_t | REPLY_TIME_MIN = 2 |
Base class for DdtDataPublishers and DdtDataSubscribers.
|
explicit |
Constructor
|
explicit |
Constructor, taking a log4cplus logger as input
|
virtual |
Destructor
|
protected |
Verifies that the heartbeat timeout retrieved from the broker is greater than reply time.
Make sure the heartbeat timeout is greater than the reply time! If not, recreate MAL client with new reply time.
reset reply_time (the connection manager makes sure that the heartbeat timeout has a valid value (at least 3s)
|
protected |
This function reads the environment variable DDT_TRANSFERCONFIG_PATH and returns path and name of the configuration file.
check if DDT_TRANSFERCONFIG_PATH is set use default path otherwise
|
protected |
Initializes the MAL.
determine MAL mapping from uri and load it obtain reference to CiiFactory
Synchronous client example w/ ReplyTime QoS set. DataBrokerRegistrationSync interface is requested.
|
inlinevirtual |
Function for triggering the local broker to publish data over the network.
Reimplemented in ddt::DdtDataPublisher.
|
inlinevirtual |
Function for receiving data.
Reimplemented in ddt::DdtDataSubscriber.
|
inlinevirtual |
Function for registering a publisher at the local broker using a MAL client.
Reimplemented in ddt::DdtDataPublisher.
|
inlinevirtual |
Function for registering a subscriber at the local broker using a MAL client.
Reimplemented in ddt::DdtDataSubscriber.
void DdtDataTransferLib::SetQoS | ( | const int | ddt_latency, |
const int | ddt_deadline | ||
) |
Sets quality of service parameters (latency [ms], deadline [s]).
|
protected |
Starts the heartbeat thread.
|
protected |
Stops the heartbeat thread.
|
inlinevirtual |
Function for unregistering a publisher from the local broker.
Reimplemented in ddt::DdtDataPublisher.
|
inlinevirtual |
Function for unregistering a subscriber from the local broker.
Reimplemented in ddt::DdtDataSubscriber.
|
protected |
This function verifies if the broker uri contains the path element. If not specified by the user the path element is added.
|
protected |
MAL client used to connect to data brokers.
|
protected |
Stores connection state to broker.
|
protected |
Observes the connection to the broker.
|
protected |
maximum age of a sample [s]
|
protected |
std::promise object used to stop the HeartbeatThread.
|
protected |
std::future object associated with exit_signal_heartbeat.
|
protected |
When the HearbeatThread is stopped it waits until heartbeat_active is set to false.
|
protected |
interval for the heartbeat in [s] retrieved from the data broker
|
protected |
duration between send and receive cannot be greater than 'latency' [ms]
|
protected |
Logger object
|
protected |
|
protected |
configurable reply time for MAL clients in [s]
|
protected |
Default value for the reply time.
|
protected |
Minimum value for the reply time.