Merge pull request #4844 from jrw972/gh-actions-flag-cleanup
[OpenDDS.git] / performance-tests / bench / builder / DataReader.h
blob6c3e2d7a5c84359fe37442273fafc6c6d07485de
1 #pragma once
3 #include "TopicManager.h"
5 #include <dds/DdsDcpsSubscriptionC.h>
7 namespace Builder {
9 class DataReader : public ListenerFactory<DDS::DataReaderListener> {
10 public:
11 DataReader(const DataReaderConfig& config, DataReaderReport& report, DDS::Subscriber_var& subscriber,
12 const std::shared_ptr<TopicManager>& topics, const ContentFilteredTopicMap& cft_map);
13 ~DataReader();
15 bool enable(bool throw_on_error = false);
17 void detach_listener();
19 DDS::DataReader_var get_dds_datareader() { return datareader_; }
20 const DDS::DataReader_var get_dds_datareader() const { return datareader_; }
22 DDS::DataReaderListener_var get_dds_datareaderlistener() { return listener_; }
23 const DDS::DataReaderListener_var get_dds_datareaderlistener() const { return listener_; }
25 DataReaderReport& get_report() { return report_; }
26 const DataReaderReport& get_report() const { return report_; }
28 DDS::DataReaderQos& get_qos() { return qos_; }
29 const DDS::DataReaderQos& get_qos() const { return qos_; }
31 const std::string& get_topic_name() const { return topic_name_; }
33 protected:
34 std::string name_;
35 std::string topic_name_;
36 std::string cft_name_;
37 std::string listener_type_name_;
38 const uint32_t listener_status_mask_;
39 Builder::PropertySeq listener_properties_;
40 const std::string transport_config_name_;
41 DataReaderReport& report_;
42 DDS::Subscriber_var subscriber_;
43 DDS::DataReaderListener_var listener_;
44 DDS::DataReader_var datareader_;
45 PropertyIndex create_time_;
46 PropertyIndex enable_time_;
47 PropertyIndex last_discovery_time_;
48 DDS::DataReaderQos qos_;
51 using ReaderMap = std::map<std::string, std::shared_ptr<DataReader>>;