RtpsUdpInst.h

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Distributed under the OpenDDS License.
00005  * See: http://www.opendds.org/license.html
00006  */
00007 
00008 #ifndef DCPS_RTPSUDPINST_H
00009 #define DCPS_RTPSUDPINST_H
00010 
00011 #include "Rtps_Udp_Export.h"
00012 
00013 #include "dds/DCPS/transport/framework/TransportInst.h"
00014 #include "dds/DCPS/SafetyProfileStreams.h"
00015 
00016 namespace OpenDDS {
00017 namespace RTPS {
00018   class Sedp;
00019 }
00020 
00021 namespace DCPS {
00022 class RtpsUdpTransport;
00023 class TransportReceiveListener;
00024 
00025 class OpenDDS_Rtps_Udp_Export RtpsUdpInst : public TransportInst {
00026 public:
00027 
00028   bool use_multicast_;
00029   unsigned char ttl_;
00030   ACE_INET_Addr multicast_group_address_;
00031   OPENDDS_STRING multicast_interface_;
00032 
00033   size_t nak_depth_;
00034   ACE_Time_Value nak_response_delay_, heartbeat_period_,
00035     heartbeat_response_delay_, handshake_timeout_, durable_data_timeout_;
00036 
00037   virtual int load(ACE_Configuration_Heap& cf,
00038                    ACE_Configuration_Section_Key& sect);
00039 
00040   /// Diagnostic aid.
00041   virtual OPENDDS_STRING dump_to_str();
00042 
00043   bool is_reliable() const { return true; }
00044   bool requires_cdr() const { return true; }
00045 
00046   virtual size_t populate_locator(OpenDDS::DCPS::TransportLocator& trans_info) const;
00047   const TransportBLOB* get_blob(const OpenDDS::DCPS::TransportLocatorSeq& trans_info) const;
00048 
00049   OPENDDS_STRING local_address_string() const { return local_address_config_str_; }
00050   ACE_INET_Addr local_address() const { return local_address_; }
00051   void local_address(const char* str)
00052   {
00053     local_address_config_str_ = str;
00054     local_address_.set(str);
00055   }
00056   void local_address(u_short port_number, const char* host_name)
00057   {
00058     local_address_config_str_ = host_name;
00059     local_address_config_str_ += ":" + to_dds_string(port_number);
00060     local_address_.set(port_number, host_name);
00061   }
00062   void local_address_set_port(u_short port_number) {
00063     local_address_.set_port_number(port_number);
00064     size_t pos = local_address_config_str_.find_last_of(":");
00065     OPENDDS_STRING host_name = local_address_config_str_.substr(0, pos);
00066     local_address_config_str_ = host_name + ":" + to_dds_string(port_number);
00067   }
00068 
00069 private:
00070   friend class RtpsUdpType;
00071   explicit RtpsUdpInst(const OPENDDS_STRING& name);
00072 
00073   TransportImpl* new_impl(const TransportInst_rch& inst);
00074 
00075   friend class RTPS::Sedp;
00076   friend class RtpsUdpTransport;
00077   TransportReceiveListener* opendds_discovery_default_listener_;
00078   RepoId opendds_discovery_guid_;
00079 
00080   ACE_INET_Addr local_address_;
00081   OPENDDS_STRING local_address_config_str_;
00082 };
00083 
00084 } // namespace DCPS
00085 } // namespace OpenDDS
00086 
00087 #endif  /* DCPS_RTPSUDPINST_H */

Generated on Fri Feb 12 20:05:26 2016 for OpenDDS by  doxygen 1.4.7