|
ddt
0.1
|
#include <ddtDataConsumer.hpp>
Public Types | |
| enum | SubscriberType { LOCAL, REMOTE } |
Public Types inherited from ddt::DdtProducerConsumerBase | |
| enum | NotificationType { NEW_DATA, PUB_REG, PUB_UNREG, SHM_DEL } |
Public Member Functions | |
| DdtDataConsumer (const std::string &data_stream_identifier, const int32_t latency, const int32_t deadline, DdtLogger *ddt_logger) | |
| DdtDataConsumer (const std::string &data_stream_identifier, const std::string &subscription_uri, const int32_t latency, const int32_t deadline, DdtLogger *ddt_logger) | |
| virtual | ~DdtDataConsumer () |
| void | StartSubscription () |
| void | StopSubscription () |
| void | AddUuid (std::string uuid, SubscriberType type) |
| void | RemoveUuid (std::string uuid) |
| void | Notify (const NotificationType type) override |
| int32_t | get_number_of_subscribers () |
| int32_t | get_number_of_remote_subscribers () |
| std::map< std::string, SubscriberType > | get_subscribers () |
| const std::string | get_remote_broker_uri () |
| const int32_t | get_notification_port () |
| DdtStatistics | get_statistics () |
| void | ResetStatistics () |
| const std::string | get_publishing_uri () |
| void | set_remote_broker_uri (const std::string &remote_uri) |
| void | set_number_of_samples (const int32_t num_samples) |
| void | set_memory_accessor (DdtMemoryAccessor *memory_accessor) |
| void | set_notification_port (const int32_t noti_port) |
| void | set_publishing_uri (const std::string pub_uri) |
Public Member Functions inherited from ddt::DdtProducerConsumerBase | |
| DdtProducerConsumerBase (DdtLogger *logger) | |
| virtual | ~DdtProducerConsumerBase () |
Public Attributes | |
| signal_n | notification_signal |
Additional Inherited Members | |
Protected Member Functions inherited from ddt::DdtProducerConsumerBase | |
| void | LoadDefaults () |
| void | ReadIni () |
| void | PrintConfigValues () |
| int32_t | GetFreePort () |
Protected Attributes inherited from ddt::DdtProducerConsumerBase | |
| int32_t | min_port |
| int32_t | max_port |
| DdtLogger * | logger |
| const int | MIN_PORT_DEFAULT = 5100 |
| const int | MAX_PORT_DEFAULT = 5500 |
| const int | MIN_RANGE = 3 |
| const int | LINE_LENGTH = 256 |
This class provides the functionality to subscribe to a data stream, to write the received data into shared memory and to notify DdtDataSubscribers that new data is available. There will be one data consumer object per data stream identifier and thus several DdtDataSubscribers may share one consumer object.
| DdtDataConsumer::DdtDataConsumer | ( | const std::string & | data_stream_identifier, |
| const int32_t | latency, | ||
| const int32_t | deadline, | ||
| DdtLogger * | ddt_logger | ||
| ) |
Constructor
| DdtDataConsumer::DdtDataConsumer | ( | const std::string & | data_stream_identifier, |
| const std::string & | subscription_uri, | ||
| const int32_t | latency, | ||
| const int32_t | deadline, | ||
| DdtLogger * | ddt_logger | ||
| ) |
Constructor
|
virtualdefault |
Destructor
| void DdtDataConsumer::AddUuid | ( | std::string | uuid, |
| SubscriberType | type | ||
| ) |
Adds the UUID of a DdtDataSubscriber to the subscriber_map.
| const int32_t DdtDataConsumer::get_notification_port | ( | ) |
Returns notification_port.
| int32_t DdtDataConsumer::get_number_of_remote_subscribers | ( | ) |
Returns the number of remote DdtDataSubscribers attached to a consumer object.
| int32_t DdtDataConsumer::get_number_of_subscribers | ( | ) |
Returns the number of all DdtDataSubscribers attached to a consumer object.
| const std::string DdtDataConsumer::get_publishing_uri | ( | ) |
Returns publishing_uri.
| const std::string DdtDataConsumer::get_remote_broker_uri | ( | ) |
Returns remote_broker_uri.
| DdtStatistics DdtDataConsumer::get_statistics | ( | ) |
Returns the statistics.
| std::map< std::string, DdtDataConsumer::SubscriberType > DdtDataConsumer::get_subscribers | ( | ) |
Returns the map with the uuids of DdtDataSubscribers attached to a consumer object.
|
overridevirtual |
Sends a notification to local subscribers.
Implements ddt::DdtProducerConsumerBase.
| void DdtDataConsumer::RemoveUuid | ( | std::string | uuid | ) |
Removes the UUID of a DdtDataSubscriber from the subscriber_map.
| void DdtDataConsumer::ResetStatistics | ( | ) |
Resets the statistics to zero in case the shared memory was deleted.
| void DdtDataConsumer::set_memory_accessor | ( | DdtMemoryAccessor * | memory_accessor | ) |
Sets memory_accessor.
| void DdtDataConsumer::set_notification_port | ( | const int32_t | noti_port | ) |
Sets notification_port.
| void DdtDataConsumer::set_number_of_samples | ( | const int32_t | num_samples | ) |
Sets number_of_samples.
| void DdtDataConsumer::set_publishing_uri | ( | const std::string | pub_uri | ) |
Sets the publishing_uri.
| void DdtDataConsumer::set_remote_broker_uri | ( | const std::string & | remote_uri | ) |
Sets remote_broker_uri.
| void DdtDataConsumer::StartSubscription | ( | ) |
Starts MAL subscription as a separate thread.
| void DdtDataConsumer::StopSubscription | ( | ) |
Stops MAL subscription.
| signal_n ddt::DdtDataConsumer::notification_signal |
Boost signal to send the notification type received via MALps.