ddt  0.1
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ddt::DdtDataPublisher Class Reference

#include <ddtDataPublisher.hpp>

Inheritance diagram for ddt::DdtDataPublisher:
ddt::DdtDataTransferLib DdtDataPublisherFake

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 DataSampleReadData ()
 

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
 
DdtLoggerlogger
 
const int32_t REPLY_TIME_DEFAULT = 6
 
const int32_t REPLY_TIME_MIN = 2
 

Detailed Description

This class provides the functionality for publisher applications to register / unregister at a local broker and to publish data for a specified data stream.

Constructor & Destructor Documentation

◆ DdtDataPublisher()

DdtDataPublisher::DdtDataPublisher ( DdtLogger logger)

Constructor

◆ ~DdtDataPublisher()

DdtDataPublisher::~DdtDataPublisher ( )
virtual

Destructor

Member Function Documentation

◆ get_connected_to_broker()

bool DdtDataPublisher::get_connected_to_broker ( )

Returns connected_to_broker.

◆ LoadDefaults()

void DdtDataPublisher::LoadDefaults ( )
protected

Loads default values for configuration parameters.

◆ PublishData()

void DdtDataPublisher::PublishData ( )
overridevirtual

Function for triggering the local broker to publish data over the network.

Reimplemented from ddt::DdtDataTransferLib.

◆ ReadIni()

void DdtDataPublisher::ReadIni ( )
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.

◆ RegisterPublisher()

int DdtDataPublisher::RegisterPublisher ( std::string  broker_uri,
std::string  data_stream_identifier,
bool  compute_checksum 
)
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.

◆ set_topic_id()

void DdtDataPublisher::set_topic_id ( int  topic_id)

Sets the topic_id.

◆ SetBufferSize()

void DdtDataPublisher::SetBufferSize ( int  max_data_sample_size,
int  number_of_samples 
)

Specifies the maximum data sample size and the number of samples.

◆ UnregisterPublisher()

int DdtDataPublisher::UnregisterPublisher ( )
overridevirtual

Function for unregistering a publisher from the local broker.

Reimplemented from ddt::DdtDataTransferLib.

◆ WriteData()

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.

Member Data Documentation

◆ topic_id

int ddt::DdtDataPublisher::topic_id
protected

Topic ID of the data


The documentation for this class was generated from the following files: