MADARA  3.1.8
SpliceDDSTransport.h
Go to the documentation of this file.
1 #ifndef _MADARA_SPLICE_DDS_TRANSPORT_H__
2 #define _MADARA_SPLICE_DDS_TRANSPORT_H_
3 
4 #include <string>
5 
9 #include "ccpp_dds_dcps.h"
10 #include "madara/transport/splice/ccpp_SpliceKnowledgeUpdate.h"
12 
13 namespace madara
14 {
15  namespace transport
16  {
22  class SpliceDDSTransport : public Base
23  {
24  public:
25 
26  enum {
30  };
31 
32  static const int PROFILES = 2;
33 
41  SpliceDDSTransport (const std::string & id,
43  TransportSettings & config, bool launch_transport);
44 
49 
55  long send_data (const knowledge::KnowledgeRecords & updates);
56 
57 #ifdef _USE_CID_
58 
63  long start_latency (void);
64 
69  long vote (void);
70 #endif // #ifdef _USE_CID_
71 
76  int reliability (void) const;
77 
82  int reliability (const int & setting);
83 
87  void close (void);
88 
94  int setup (void);
95  protected:
96  private:
97 
100 
103 
104  const static char * topic_names_[];
105  const static char * partition_;
106  const static char * ret_code_names[];
107 
108  DDS::DomainParticipantQos part_qos_;
109  DDS::TopicQos topic_qos_;
110  DDS::PublisherQos pub_qos_;
111  DDS::DataWriterQos datawriter_qos_;
112  DDS::SubscriberQos sub_qos_;
113  DDS::DataReaderQos datareader_qos_;
114 
115  DDS::DomainId_t domain_;
116  DDS::DomainParticipantFactory_var domain_factory_;
117  DDS::DomainParticipant_var domain_participant_;
118  DDS::Publisher_var publisher_;
119  DDS::Subscriber_var subscriber_;
120  DDS::DataWriter_var datawriter_;
121  DDS::DataReader_var datareader_;
122  DDS::DataWriter_var latencywriter_;
123 
124  Knowledge::UpdateDataWriter_var update_writer_;
125  Knowledge::UpdateDataWriter_var latency_update_writer_;
126  Knowledge::UpdateDataReader_var update_reader_;
127  Knowledge::UpdateTypeSupport update_type_support_;
128 
129  DDS::Topic_var update_topic_;
130 
134  void check_handle (void * handle, const char *info);
135 
139  void check_status (DDS::ReturnCode_t status, const char * info);
140 
144  const char * get_error_name (DDS::ReturnCode_t status);
145  };
146  }
147 }
148 
149 #endif
int reliability(void) const
Accesses reliability setting.
This class stores variables and their values for use by any entity needing state information in a thr...
DDS::DomainParticipant_var domain_participant_
Knowledge::UpdateDataReader_var update_reader_
Holds basic transport settings.
Knowledge::UpdateDataWriter_var update_writer_
DDS::DomainParticipantFactory_var domain_factory_
long send_data(const knowledge::KnowledgeRecords &updates)
Sends a list of knowledge updates to listeners.
threads::Threader read_threads_
threads for reading knowledge updates
void check_handle(void *handle, const char *info)
Splice handle checker.
This class provides an interface into the Open Splice dissemination transport.
SpliceDDSTransport(const std::string &id, knowledge::ThreadSafeContext &context, TransportSettings &config, bool launch_transport)
Constructor.
This class provides a distributed knowledge base to users.
Definition: KnowledgeBase.h:44
::std::map< std::string, KnowledgeRecord * > KnowledgeRecords
knowledge::KnowledgeBase knowledge_
knowledge base for threads to use
Knowledge::UpdateDataWriter_var latency_update_writer_
Knowledge::UpdateTypeSupport update_type_support_
int setup(void)
Activates this transport.
static constexpr struct madara::knowledge::tags::string_t string
Starts threads with first class support of MADARA contexts.
Definition: Threader.h:35
void close(void)
Closes this transport.
void check_status(DDS::ReturnCode_t status, const char *info)
Splice status checker.
Copyright (c) 2015 Carnegie Mellon University.
const char * get_error_name(DDS::ReturnCode_t status)
Returns error name of the specific status.
Base class from which all transports must be derived.
Definition: Transport.h:62