|
ddt
0.1
|
#include <ddtDataPublisher.hpp>
Public Member Functions | |
| DdtDataPublisher (DdtLogger *logger) | |
| virtual | ~DdtDataPublisher () |
| int | RegisterPublisher (std::string broker_uri, std::string data_stream_identifier, bool compute_checksum) override |
| int | UnregisterPublisher () override |
| void | PublishData () override |
| void | SetBufferSize (int max_data_sample_size, int number_of_samples) |
| void | WriteData (int32_t sample_id, const std::vector< uint8_t > &datavec, const std::vector< uint8_t > &metadatavec) |
| void | set_topic_id (int topic_id) |
| bool | get_connected_to_broker () |
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 | RegisterSubscriber (std::string broker_uri, std::string data_stream_identifier, std::string remote_broker_uri, int32_t reading_interval=10) |
| virtual int | UnregisterSubscriber () |
| virtual DataSample * | ReadData () |
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 | |
| int | topic_id |
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 publisher applications to register / unregister at a local broker and to publish data for a specified data stream.
| DdtDataPublisher::DdtDataPublisher | ( | DdtLogger * | logger | ) |
Constructor
|
virtual |
Destructor
| bool DdtDataPublisher::get_connected_to_broker | ( | ) |
Returns connected_to_broker.
|
protected |
Loads default values for configuration parameters.
|
overridevirtual |
Function for triggering the local broker to publish data over the network.
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 publisher at the local broker using a MAL client.
Synchronous client example w/ ReplyTime QoS set. DataBrokerRegistrationSync interface is requested.
Reimplemented from ddt::DdtDataTransferLib.
| void DdtDataPublisher::set_topic_id | ( | int | topic_id | ) |
Sets the topic_id.
| void DdtDataPublisher::SetBufferSize | ( | int | max_data_sample_size, |
| int | number_of_samples | ||
| ) |
Specifies the maximum data sample size and the number of samples.
|
overridevirtual |
Function for unregistering a publisher from the local broker.
Reimplemented from ddt::DdtDataTransferLib.
| void DdtDataPublisher::WriteData | ( | int32_t | sample_id, |
| const std::vector< uint8_t > & | datavec, | ||
| const std::vector< uint8_t > & | metadatavec | ||
| ) |
Writes the data packet into shared memory using a memory accessor.
|
protected |
Topic ID of the data