NetworkAddress.h File Reference

#include "dds/DCPS/dcps_export.h"
#include "dds/DCPS/PoolAllocator.h"
#include "tao/Basic_Types.h"
#include "ace/INET_Addr.h"
#include "ace/CDR_Stream.h"
#include "ace/SString.h"
#include "ace/SOCK_Dgram.h"

Include dependency graph for NetworkAddress.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  OpenDDS
namespace  OpenDDS::DCPS

Classes

struct  OpenDDS::DCPS::HostnameInfo
struct  OpenDDS::DCPS::NetworkAddress
 Defines a wrapper around address info which is used for advertise. More...

Functions

typedef OpenDDS::DCPS::OPENDDS_VECTOR (HostnameInfo) HostnameInfoVector
OPENDDS_STRING OpenDDS::DCPS::get_fully_qualified_hostname (ACE_INET_Addr *addr)
void OpenDDS::DCPS::get_interface_addrs (OPENDDS_VECTOR(ACE_INET_Addr)&addrs)
bool OpenDDS::DCPS::set_socket_multicast_ttl (const ACE_SOCK_Dgram &socket, const unsigned char &ttl)
bool OpenDDS::DCPS::open_appropriate_socket_type (ACE_SOCK_Dgram &socket, const ACE_INET_Addr &local_address)
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
OpenDDS_Dcps_Export ACE_CDR::Boolean 
operator<< (ACE_OutputCDR &outCdr, OpenDDS::DCPS::NetworkAddress &value)
 Marshal into a buffer.
OpenDDS_Dcps_Export ACE_CDR::Boolean operator>> (ACE_InputCDR &inCdr, OpenDDS::DCPS::NetworkAddress &value)
 Demarshal from a buffer.


Function Documentation

ACE_BEGIN_VERSIONED_NAMESPACE_DECL OpenDDS_Dcps_Export ACE_CDR::Boolean operator<< ( ACE_OutputCDR &  outCdr,
OpenDDS::DCPS::NetworkAddress value 
)

Marshal into a buffer.

Definition at line 21 of file NetworkAddress.cpp.

References OpenDDS::DCPS::NetworkAddress::addr_, and OpenDDS::DCPS::NetworkAddress::reserved_.

00022 {
00023   outCdr << ACE_OutputCDR::from_boolean(ACE_CDR_BYTE_ORDER);
00024 
00025   outCdr << ACE_OutputCDR::from_octet(value.reserved_);
00026   outCdr << value.addr_.c_str();
00027 
00028   return outCdr.good_bit();
00029 }

OpenDDS_Dcps_Export ACE_CDR::Boolean operator>> ( ACE_InputCDR &  inCdr,
OpenDDS::DCPS::NetworkAddress value 
)

Demarshal from a buffer.

Definition at line 32 of file NetworkAddress.cpp.

References OpenDDS::DCPS::NetworkAddress::addr_, and OpenDDS::DCPS::NetworkAddress::reserved_.

00033 {
00034   CORBA::Boolean byte_order;
00035 
00036   if ((inCdr >> ACE_InputCDR::to_boolean(byte_order)) == 0)
00037     return 0;
00038 
00039   inCdr.reset_byte_order(byte_order);
00040 
00041   if ((inCdr >> ACE_InputCDR::to_octet(value.reserved_)) == 0)
00042     return 0;
00043 
00044   char* buf = 0;
00045 
00046   if ((inCdr >> buf) == 0)
00047     return 0;
00048 
00049   value.addr_ = buf;
00050 
00051   delete[] buf;
00052 
00053   return inCdr.good_bit();
00054 }


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