#include <UIPMC_Endpoint.h>
Inheritance diagram for TAO_UIPMC_Endpoint:
Public Member Functions | |
TAO_UIPMC_Endpoint (void) | |
Default constructor. | |
TAO_UIPMC_Endpoint (const ACE_INET_Addr &addr) | |
Constructor. | |
TAO_UIPMC_Endpoint (const CORBA::Octet class_d_address[4], CORBA::UShort port) | |
Constructor. Frank - deprecate this. | |
~TAO_UIPMC_Endpoint (void) | |
Destructor. | |
virtual TAO_Endpoint * | next (void) |
virtual int | addr_to_string (char *buffer, size_t length) |
virtual TAO_Endpoint * | duplicate (void) |
Makes a copy of . | |
CORBA::Boolean | is_equivalent (const TAO_Endpoint *other_endpoint) |
CORBA::ULong | hash (void) |
Return a hash value for this object. | |
const ACE_INET_Addr & | object_addr (void) const |
Return a reference to the . | |
void | object_addr (const ACE_INET_Addr &addr) |
Set the IP multicast address and port. | |
const char * | get_host_addr (void) const |
CORBA::UShort | port (void) const |
Return the port number. | |
CORBA::UShort | port (CORBA::UShort p) |
Set the port number. | |
Private Member Functions | |
ACE_UINT32 | uint_ip_addr (void) const |
Helper methods for getting and setting the IP address. | |
void | uint_ip_addr (ACE_UINT32 ip_addr) |
void | update_object_addr (void) |
Helper method to update the cached object address. | |
Private Attributes | |
CORBA::Octet | class_d_address_ [4] |
IP Multicast address. Frank - deprecate this. | |
CORBA::UShort | port_ |
UDP port number. Frank - deprecate this. | |
ACE_INET_Addr | object_addr_ |
TAO_UIPMC_Endpoint * | next_ |
UIPMC-specific implementation of PP Framework Endpoint interface.
Definition at line 39 of file UIPMC_Endpoint.h.
|
Default constructor.
Definition at line 24 of file UIPMC_Endpoint.cpp.
00025 : TAO_Endpoint (IOP::TAG_UIPMC), 00026 object_addr_ (), 00027 next_ (0) 00028 { 00029 } |
|
Constructor.
Definition at line 32 of file UIPMC_Endpoint.cpp. References object_addr().
00033 : TAO_Endpoint (IOP::TAG_UIPMC), 00034 object_addr_ (addr), 00035 next_ (0) 00036 { 00037 this->object_addr (addr); 00038 } |
|
Constructor. Frank - deprecate this. @ Definition at line 40 of file UIPMC_Endpoint.cpp. References class_d_address_, and update_object_addr().
00042 : TAO_Endpoint (IOP::TAG_UIPMC), 00043 port_ (port), 00044 next_ (0) 00045 { 00046 for (int i = 0; i<4; i++) 00047 this->class_d_address_[i] = class_d_address[i]; 00048 00049 this->update_object_addr (); 00050 } |
|
Destructor.
Definition at line 53 of file UIPMC_Endpoint.cpp.
00054 { 00055 00056 } |
|
Implements TAO_Endpoint. Definition at line 75 of file UIPMC_Endpoint.cpp. References ACE_OS::sprintf().
00076 { 00077 size_t actual_len = 00078 15 // chars in dotted decimal addr 00079 + sizeof (':') // delimiter 00080 + 5 // max port 00081 + sizeof ('\0'); 00082 00083 if (length < actual_len) 00084 return -1; 00085 00086 ACE_OS::sprintf (buffer, "%d.%d.%d.%d:%d", 00087 this->class_d_address_[0], 00088 this->class_d_address_[1], 00089 this->class_d_address_[2], 00090 this->class_d_address_[3], 00091 this->port_); 00092 00093 return 0; 00094 } |
|
Makes a copy of .
Implements TAO_Endpoint. Definition at line 103 of file UIPMC_Endpoint.cpp. References ACE_NEW_RETURN.
00104 { 00105 TAO_UIPMC_Endpoint *endpoint = 0; 00106 00107 ACE_NEW_RETURN (endpoint, 00108 TAO_UIPMC_Endpoint (this->object_addr_), 00109 0); 00110 00111 return endpoint; 00112 } |
|
Return a pointer to the stringified host address (not including the port). This class retains ownership of the address memory. Definition at line 68 of file UIPMC_Endpoint.cpp. References ACE_INET_Addr::get_host_addr().
00069 { 00070 return this->object_addr_.get_host_addr (); 00071 } |
|
Return a hash value for this object.
Implements TAO_Endpoint. Definition at line 129 of file UIPMC_Endpoint.cpp. References ACE_GUARD_RETURN, TAO_SYNCH_MUTEX, and uint_ip_addr(). Referenced by TAO_UIPMC_Profile::hash().
00130 { 00131 if (this->hash_val_ != 0) 00132 return this->hash_val_; 00133 00134 { 00135 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, 00136 guard, 00137 this->addr_lookup_lock_, 00138 this->hash_val_); 00139 // .. DCL 00140 if (this->hash_val_ != 0) 00141 return this->hash_val_; 00142 00143 this->hash_val_ = 00144 this->uint_ip_addr () + this->port_; 00145 } 00146 00147 return this->hash_val_; 00148 } |
|
Return true if this endpoint is equivalent to . Two endpoints are equivalent iff their port and host are the same. Implements TAO_Endpoint. Definition at line 115 of file UIPMC_Endpoint.cpp. References class_d_address_, ACE_OS::memcmp(), and port_. Referenced by TAO_UIPMC_Profile::do_is_equivalent().
00116 { 00117 TAO_Endpoint *endpt = const_cast<TAO_Endpoint *> (other_endpoint); 00118 00119 TAO_UIPMC_Endpoint *endpoint = dynamic_cast<TAO_UIPMC_Endpoint *> (endpt); 00120 if (endpoint == 0) 00121 return 0; 00122 00123 return 00124 this->port_ == endpoint->port_ 00125 && ACE_OS::memcmp (this->class_d_address_, endpoint->class_d_address_, 4) == 0; 00126 } |
|
Implements TAO_Endpoint. Definition at line 97 of file UIPMC_Endpoint.cpp.
00098 { 00099 return this->next_; 00100 } |
|
Set the IP multicast address and port.
Definition at line 59 of file UIPMC_Endpoint.cpp. References ACE_INET_Addr::get_ip_address(), ACE_INET_Addr::get_port_number(), ACE_INET_Addr::set(), and uint_ip_addr().
00060 { 00061 this->port_ = addr.get_port_number(); 00062 this->uint_ip_addr (addr.get_ip_address ()); 00063 00064 this->object_addr_.set (addr); 00065 } |
|
Return a reference to the .
Definition at line 8 of file UIPMC_Endpoint.i. Referenced by TAO_UIPMC_Profile::decode_profile(), TAO_UIPMC_Connector::make_connection(), TAO_UIPMC_Profile::parse_string_i(), TAO_UIPMC_Connector::set_validate_endpoint(), and TAO_UIPMC_Endpoint().
00009 { 00010 return this->object_addr_; 00011 } |
|
Set the port number.
Definition at line 21 of file UIPMC_Endpoint.i.
00022 { 00023 return this->port_ = p; 00024 } |
|
Return the port number.
Definition at line 15 of file UIPMC_Endpoint.i. Referenced by TAO_UIPMC_Profile::to_string().
00016 { 00017 return this->port_; 00018 } |
|
Definition at line 37 of file UIPMC_Endpoint.i. References class_d_address_.
00038 { 00039 this->class_d_address_[0] = (CORBA::Char)(ip_addr >> 24); 00040 this->class_d_address_[1] = (CORBA::Char)((ip_addr >> 16) & 0xff); 00041 this->class_d_address_[2] = (CORBA::Char)((ip_addr >> 8) & 0xff); 00042 this->class_d_address_[3] = (CORBA::Char)(ip_addr & 0xff); 00043 } |
|
Helper methods for getting and setting the IP address.
Definition at line 28 of file UIPMC_Endpoint.i. References class_d_address_. Referenced by hash(), and object_addr().
00029 { 00030 return (((ACE_UINT32)this->class_d_address_[0] << 24) | 00031 ((ACE_UINT32)this->class_d_address_[1] << 16) | 00032 ((ACE_UINT32)this->class_d_address_[2] << 8) | 00033 ((ACE_UINT32)this->class_d_address_[3])); 00034 } |
|
Helper method to update the cached object address.
Definition at line 46 of file UIPMC_Endpoint.i. References ACE_INET_Addr::set(). Referenced by TAO_UIPMC_Endpoint().
00047 { 00048 this->object_addr_.set (this->port_, 00049 this->uint_ip_addr ()); 00050 } |
|
IP Multicast address. Frank - deprecate this. @ Definition at line 107 of file UIPMC_Endpoint.h. Referenced by is_equivalent(), TAO_UIPMC_Endpoint(), and uint_ip_addr(). |
|
UIPMC Endpoints can be stringed into a list. Return the next endpoint in the list, if any. Definition at line 118 of file UIPMC_Endpoint.h. |
|
Cached instance of for use in making invocations, etc. Definition at line 114 of file UIPMC_Endpoint.h. |
|
UDP port number. Frank - deprecate this. @ Definition at line 110 of file UIPMC_Endpoint.h. Referenced by is_equivalent(). |