|
ddt
0.1
|
#include <ddtDataSubscriber.hpp>
Public Member Functions | |
| DdtDataSubscriber (DdtLogger *logger) | |
| virtual | ~DdtDataSubscriber () |
| int | RegisterSubscriber (std::string broker_uri, std::string data_stream_identifier, std::string remote_broker_uri, int32_t reading_interval=10) override |
| int | UnregisterSubscriber () override |
| DataSample * | ReadData () override |
| void | StartNotificationSubscription () |
| void | StopNotificationSubscription () |
| DdtStatistics | get_statistics () |
| boost::signals2::connection | connect (const signal_t::slot_type &event_listener) |
Public Member Functions inherited from ddt::DdtDataTransferLib | |
| DdtDataTransferLib (DdtLogger *ddt_logger) | |
| virtual | ~DdtDataTransferLib () |
| void | SetQoS (const int ddt_latency, const int ddt_deadline) |
| virtual int | RegisterPublisher (std::string broker_uri, std::string data_stream_identifier, bool compute_checksum) |
| virtual int | UnregisterPublisher () |
| virtual void | PublishData () |
Protected Member Functions | |
| void | LoadDefaults () |
| void | ReadIni () |
Protected Member Functions inherited from ddt::DdtDataTransferLib | |
| void | StartHeartbeat (const int32_t interval, const std::string id) |
| void | StopHeartbeat () |
| void | CheckHeartbeatTimeout (int32_t &new_reply_time) |
| const std::string | VerifyPathInBrokerUri (std::string broker_uri) |
| const std::string | GetConfigFilePath () |
Protected Attributes | |
| int32_t | max_age_data_sample |
| const int32_t | MAX_AGE_DATA_SAMPLE_DEFAULT = 10000 |
Protected Attributes inherited from ddt::DdtDataTransferLib | |
| 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 |
| const int32_t | REPLY_TIME_DEFAULT = 6 |
| const int32_t | REPLY_TIME_MIN = 2 |
This class provides the functionality for subscriber applications to register / unregister at a local broker and to receive data for a specified data stream.
| DdtDataSubscriber::DdtDataSubscriber | ( | DdtLogger * | logger | ) |
Constructor
|
virtual |
Destructor
| boost::signals2::connection DdtDataSubscriber::connect | ( | const signal_t::slot_type & | event_listener | ) |
Connects the event_listener with the DataAvailableSignal from the memory accessor.
| DdtStatistics DdtDataSubscriber::get_statistics | ( | ) |
Returns the statistics.
|
protected |
Loads default values for configuration parameters.
|
overridevirtual |
Function for receiving data.
Reimplemented from ddt::DdtDataTransferLib.
|
protected |
Reads the datatransferlib configuration file.
An exception is thrown if the config file does not exist. In that case the default values are used instead.
|
overridevirtual |
Function for registering a subscriber at the local broker using a MAL client.
Synchronous client example w/ ReplyTime QoS set. DataBrokerRegistrationSync interface is requested.
Reimplemented from ddt::DdtDataTransferLib.
| void DdtDataSubscriber::StartNotificationSubscription | ( | ) |
Starts MAL subscription for notifications as a separate thread.
| void DdtDataSubscriber::StopNotificationSubscription | ( | ) |
Stops MAL subscription.
|
overridevirtual |
Function for unregistering a subscriber from the local broker.
Reimplemented from ddt::DdtDataTransferLib.
|
protected |
configurable time window for dropping data samples in [ms]
|
protected |