Defines the base class for the "address family independent" address format. More...
#include <Addr.h>
Public Member Functions | |
ACE_Addr (int type=-1, int size=-1) | |
Initializes instance variables. | |
virtual | ~ACE_Addr (void) |
Destructor. | |
int | get_size (void) const |
Return the size of the address. | |
void | set_size (int size) |
Sets the size of the address. | |
int | get_type (void) const |
Get the type of the address. | |
void | set_type (int type) |
Set the type of the address. | |
virtual void * | get_addr (void) const |
Return a pointer to the address. | |
virtual void | set_addr (void *, int len) |
Set a pointer to the address. | |
bool | operator== (const ACE_Addr &sap) const |
Check for address equality. | |
bool | operator!= (const ACE_Addr &sap) const |
Check for address inequality. | |
void | base_set (int type, int size) |
Initializes instance variables. | |
virtual unsigned long | hash (void) const |
void | dump (void) const |
Dump the state of an object. | |
Public Attributes | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. | |
Static Public Attributes | |
static const ACE_Addr | sap_any |
Wild-card address. | |
Protected Attributes | |
int | addr_type_ |
e.g., AF_UNIX, AF_INET, AF_SPIPE, etc. | |
int | addr_size_ |
Number of bytes in the address. |
Defines the base class for the "address family independent" address format.
Definition at line 32 of file Addr.h.
ACE_Addr::ACE_Addr | ( | int | type = -1 , |
|
int | size = -1 | |||
) |
Initializes instance variables.
void ACE_Addr::base_set | ( | int | type, | |
int | size | |||
) |
Initializes instance variables.
Definition at line 52 of file Addr.cpp.
{ this->addr_type_ = type; this->addr_size_ = size; }
void ACE_Addr::dump | ( | void | ) | const |
Dump the state of an object.
Reimplemented in ACE_DEV_Addr, ACE_FILE_Addr, ACE_INET_Addr, ACE_SPIPE_Addr, and ACE_UNIX_Addr.
Definition at line 59 of file Addr.cpp.
{ #if defined (ACE_HAS_DUMP) ACE_TRACE ("ACE_Addr::dump"); ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("addr_type_ = %d"), this->addr_type_)); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\naddr_size_ = %d"), this->addr_size_)); ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); #endif /* ACE_HAS_DUMP */ }
void * ACE_Addr::get_addr | ( | void | ) | const [virtual] |
Return a pointer to the address.
Reimplemented in ACE_DEV_Addr, ACE_FILE_Addr, ACE_INET_Addr, ACE_SPIPE_Addr, and ACE_UNIX_Addr.
Definition at line 39 of file Addr.cpp.
{
return 0;
}
int ACE_Addr::get_size | ( | void | ) | const [inline] |
Return the size of the address.
Definition at line 25 of file Addr.inl.
{ return this->addr_size_; }
int ACE_Addr::get_type | ( | void | ) | const [inline] |
Get the type of the address.
Return the type of the address.
Definition at line 39 of file Addr.inl.
{ return this->addr_type_; }
unsigned long ACE_Addr::hash | ( | void | ) | const [inline, virtual] |
Returns a hash value. This should be overwritten by a subclass that can produce a better hash value.
Reimplemented in ACE_INET_Addr, and ACE_UNIX_Addr.
Definition at line 52 of file Addr.inl.
{
return 0;
}
bool ACE_Addr::operator!= | ( | const ACE_Addr & | sap | ) | const [inline] |
Check for address inequality.
Definition at line 17 of file Addr.inl.
{ return (sap.addr_type_ != this->addr_type_ || sap.addr_size_ != this->addr_size_ ); }
bool ACE_Addr::operator== | ( | const ACE_Addr & | sap | ) | const [inline] |
Check for address equality.
Definition at line 10 of file Addr.inl.
{ return (sap.addr_type_ == this->addr_type_ && sap.addr_size_ == this->addr_size_ ); }
void ACE_Addr::set_addr | ( | void * | , | |
int | len | |||
) | [virtual] |
Set a pointer to the address.
Reimplemented in ACE_INET_Addr, ACE_SPIPE_Addr, and ACE_UNIX_Addr.
Definition at line 45 of file Addr.cpp.
{ }
void ACE_Addr::set_size | ( | int | size | ) | [inline] |
void ACE_Addr::set_type | ( | int | type | ) | [inline] |
Declare the dynamic allocation hooks.
Reimplemented in ACE_DEV_Addr, ACE_FILE_Addr, ACE_INET_Addr, ACE_SPIPE_Addr, and ACE_UNIX_Addr.
int ACE_Addr::addr_size_ [protected] |
int ACE_Addr::addr_type_ [protected] |
const ACE_Addr ACE_Addr::sap_any [static] |