OpenDDS::DCPS::UdpInst Class Reference

#include <UdpInst.h>

Inheritance diagram for OpenDDS::DCPS::UdpInst:
Inheritance graph
[legend]
Collaboration diagram for OpenDDS::DCPS::UdpInst:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual int load (ACE_Configuration_Heap &cf, ACE_Configuration_Section_Key &sect)
virtual OPENDDS_STRING dump_to_str () const
 Diagnostic aid.
bool is_reliable () const
 Does the transport as configured support RELIABLE_RELIABILITY_QOS?
virtual size_t populate_locator (OpenDDS::DCPS::TransportLocator &trans_info) const
 Populate a transport locator sequence. Return the number of "locators.".
OPENDDS_STRING local_address_string () const
ACE_INET_Addr local_address () const
void local_address (const char *str)
void local_address (u_short port_number, const char *host_name)
void local_address_set_port (u_short port_number)

Public Attributes

ACE_INT32 send_buffer_size_
ACE_INT32 rcv_buffer_size_

Private Member Functions

 UdpInst (const std::string &name)
TransportImpl_rch new_impl ()

Private Attributes

ACE_INET_Addr local_address_
OPENDDS_STRING local_address_config_str_

Friends

class UdpType
class UdpDataLink
template<typename T , typename U >
RcHandle< T > OpenDDS::DCPS::make_rch (U const &)

Detailed Description

Definition at line 24 of file UdpInst.h.


Constructor & Destructor Documentation

OpenDDS::DCPS::UdpInst::UdpInst ( const std::string &  name  )  [explicit, private]

Definition at line 24 of file UdpInst.cpp.

References defined(), and if().

00025   : TransportInst("udp", name),
00026 #if defined (ACE_DEFAULT_MAX_SOCKET_BUFSIZ)
00027     send_buffer_size_(ACE_DEFAULT_MAX_SOCKET_BUFSIZ),
00028     rcv_buffer_size_(ACE_DEFAULT_MAX_SOCKET_BUFSIZ)
00029 #else
00030     send_buffer_size_(0),
00031     rcv_buffer_size_(0)
00032 #endif
00033 {
00034 }

Here is the call graph for this function:


Member Function Documentation

OPENDDS_STRING OpenDDS::DCPS::UdpInst::dump_to_str (  )  const [virtual]

Diagnostic aid.

Reimplemented from OpenDDS::DCPS::TransportInst.

Definition at line 64 of file UdpInst.cpp.

References OpenDDS::DCPS::TransportInst::formatNameForDump(), ACE_INET_Addr::get_host_addr(), ACE_INET_Addr::get_port_number(), local_address(), OPENDDS_STRING, rcv_buffer_size_, and send_buffer_size_.

00065 {
00066   std::ostringstream os;
00067   os << TransportInst::dump_to_str() << std::endl;
00068 
00069   os << formatNameForDump("local_address") << this->local_address().get_host_addr()
00070                                            << ":" << this->local_address().get_port_number() << std::endl;
00071   os << formatNameForDump("send_buffer_size") << this->send_buffer_size_ << std::endl;
00072   os << formatNameForDump("rcv_buffer_size") << this->rcv_buffer_size_ << std::endl;
00073   return OPENDDS_STRING(os.str());
00074 }

Here is the call graph for this function:

bool OpenDDS::DCPS::UdpInst::is_reliable (  )  const [inline, virtual]

Does the transport as configured support RELIABLE_RELIABILITY_QOS?

Implements OpenDDS::DCPS::TransportInst.

Definition at line 35 of file UdpInst.h.

00035 { return false; }

int OpenDDS::DCPS::UdpInst::load ( ACE_Configuration_Heap cf,
ACE_Configuration_Section_Key sect 
) [virtual]

Overwrite the default configurations with the configuration from the given section in the ACE_Configuration_Heap object.

Reimplemented from OpenDDS::DCPS::TransportInst.

Definition at line 43 of file UdpInst.cpp.

References ACE_TEXT(), ACE_TEXT_ALWAYS_CHAR, ACE_String_Base< ACE_CHAR_T >::c_str(), ACE_String_Base< ACE_CHAR_T >::empty(), GET_CONFIG_TSTRING_VALUE, GET_CONFIG_VALUE, local_address(), rcv_buffer_size_, and send_buffer_size_.

00045 {
00046   TransportInst::load(cf, sect); // delegate to parent
00047 
00048   ACE_TString local_address_s;
00049   GET_CONFIG_TSTRING_VALUE(cf, sect, ACE_TEXT("local_address"),
00050                            local_address_s);
00051 
00052   if (!local_address_s.empty()) {
00053     local_address(ACE_TEXT_ALWAYS_CHAR(local_address_s.c_str()));
00054   }
00055 
00056   GET_CONFIG_VALUE(cf, sect, ACE_TEXT("send_buffer_size"), this->send_buffer_size_, ACE_UINT32);
00057 
00058   GET_CONFIG_VALUE(cf, sect, ACE_TEXT("rcv_buffer_size"), this->rcv_buffer_size_, ACE_UINT32);
00059 
00060   return 0;
00061 }

Here is the call graph for this function:

void OpenDDS::DCPS::UdpInst::local_address ( u_short  port_number,
const char *  host_name 
) [inline]

Definition at line 46 of file UdpInst.h.

References OpenDDS::DCPS::to_dds_string().

00047   {
00048     local_address_config_str_ = host_name;
00049     local_address_config_str_ += ":" + to_dds_string(port_number);
00050     local_address_.set(port_number, host_name);
00051   }

Here is the call graph for this function:

void OpenDDS::DCPS::UdpInst::local_address ( const char *  str  )  [inline]

Definition at line 41 of file UdpInst.h.

References ACE_INET_Addr::set().

00042   {
00043     local_address_config_str_ = str;
00044     local_address_.set(str);
00045   }

Here is the call graph for this function:

ACE_INET_Addr OpenDDS::DCPS::UdpInst::local_address (  )  const [inline]

Definition at line 40 of file UdpInst.h.

Referenced by OpenDDS::DCPS::UdpTransport::configure_i(), dump_to_str(), load(), OpenDDS::DCPS::UdpDataLink::open(), and populate_locator().

00040 { return local_address_; }

Here is the caller graph for this function:

void OpenDDS::DCPS::UdpInst::local_address_set_port ( u_short  port_number  )  [inline]

Definition at line 52 of file UdpInst.h.

Referenced by OpenDDS::DCPS::UdpDataLink::open().

00052                                                    {
00053     local_address_.set_port_number(port_number);
00054     set_port_in_addr_string(local_address_config_str_, port_number);
00055   }

Here is the caller graph for this function:

OPENDDS_STRING OpenDDS::DCPS::UdpInst::local_address_string (  )  const [inline]

Definition at line 39 of file UdpInst.h.

Referenced by populate_locator().

00039 { return local_address_config_str_; }

Here is the caller graph for this function:

TransportImpl_rch OpenDDS::DCPS::UdpInst::new_impl (  )  [private, virtual]

Implements OpenDDS::DCPS::TransportInst.

Definition at line 37 of file UdpInst.cpp.

References OpenDDS::DCPS::ref().

00038 {
00039   return make_rch<UdpTransport>(ref(*this));
00040 }

Here is the call graph for this function:

size_t OpenDDS::DCPS::UdpInst::populate_locator ( OpenDDS::DCPS::TransportLocator trans_info  )  const [virtual]

Populate a transport locator sequence. Return the number of "locators.".

Implements OpenDDS::DCPS::TransportInst.

Definition at line 77 of file UdpInst.cpp.

References ACE_OutputCDR::buffer(), OpenDDS::DCPS::TransportLocator::data, len, local_address(), local_address_string(), ACE_OutputCDR::total_length(), and OpenDDS::DCPS::TransportLocator::transport_type.

Referenced by OpenDDS::DCPS::UdpTransport::connection_info_i().

00078 {
00079   if (this->local_address() != ACE_INET_Addr()) {
00080     NetworkAddress network_address;
00081     if (!this->local_address_string().empty()) {
00082       network_address = NetworkAddress(this->local_address_string());
00083     } else {
00084       network_address = NetworkAddress(this->local_address(), true);
00085     }
00086     ACE_OutputCDR cdr;
00087     cdr << network_address;
00088 
00089     const CORBA::ULong len = static_cast<CORBA::ULong>(cdr.total_length());
00090     char* buffer = const_cast<char*>(cdr.buffer()); // safe
00091 
00092     info.transport_type = "udp";
00093     info.data = TransportBLOB(len, len, reinterpret_cast<CORBA::Octet*>(buffer));
00094     return 1;
00095   } else {
00096     return 0;
00097   }
00098 }

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

template<typename T , typename U >
RcHandle<T> OpenDDS::DCPS::make_rch ( U const &   )  [friend]
friend class UdpDataLink [friend]

Definition at line 59 of file UdpInst.h.

friend class UdpType [friend]

Definition at line 58 of file UdpInst.h.


Member Data Documentation

The address from which to send/receive data. The default value is: none.

Definition at line 68 of file UdpInst.h.

Definition at line 69 of file UdpInst.h.

Definition at line 27 of file UdpInst.h.

Referenced by dump_to_str(), load(), and OpenDDS::DCPS::UdpDataLink::open().

Definition at line 26 of file UdpInst.h.

Referenced by dump_to_str(), load(), and OpenDDS::DCPS::UdpDataLink::open().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1