ACE_Addr Class Reference

Defines the base class for the "address family independent" address format. More...

#include <Addr.h>

Inheritance diagram for ACE_Addr:
Inheritance graph
[legend]
Collaboration diagram for ACE_Addr:
Collaboration graph
[legend]

List of all members.

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.

Detailed Description

Defines the base class for the "address family independent" address format.

Definition at line 32 of file Addr.h.


Constructor & Destructor Documentation

ACE_Addr::ACE_Addr ( int  type = -1,
int  size = -1 
)

Initializes instance variables.

ACE_Addr::~ACE_Addr ( void   )  [virtual]

Destructor.

Definition at line 34 of file Addr.cpp.

00035 {
00036 }


Member Function Documentation

void ACE_Addr::base_set ( int  type,
int  size 
)

Initializes instance variables.

Definition at line 52 of file Addr.cpp.

00053 {
00054   this->addr_type_ = type;
00055   this->addr_size_ = size;
00056 }

void ACE_Addr::dump ( void   )  const

Dump the state of an object.

Reimplemented in ACE_ATM_Addr, ACE_DEV_Addr, ACE_FILE_Addr, ACE_INET_Addr, ACE_MEM_Addr, ACE_SPIPE_Addr, and ACE_UNIX_Addr.

Definition at line 59 of file Addr.cpp.

00060 {
00061 #if defined (ACE_HAS_DUMP)
00062   ACE_TRACE ("ACE_Addr::dump");
00063 
00064   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00065   ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("addr_type_ = %d"), this->addr_type_));
00066   ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\naddr_size_ = %d"), this->addr_size_));
00067   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00068 #endif /* ACE_HAS_DUMP */
00069 }

void * ACE_Addr::get_addr ( void   )  const [virtual]

Return a pointer to the address.

Reimplemented in ACE_ATM_Addr, ACE_DEV_Addr, ACE_FILE_Addr, ACE_INET_Addr, ACE_MEM_Addr, ACE_Netlink_Addr, ACE_SPIPE_Addr, and ACE_UNIX_Addr.

Definition at line 39 of file Addr.cpp.

00040 {
00041   return 0;
00042 }

int ACE_Addr::get_size ( void   )  const

Return the size of the address.

Definition at line 25 of file Addr.inl.

00026 {
00027   return this->addr_size_;
00028 }

int ACE_Addr::get_type ( void   )  const

Get the type of the address.

Return the type of the address.

Definition at line 39 of file Addr.inl.

00040 {
00041   return this->addr_type_;
00042 }

unsigned long ACE_Addr::hash ( void   )  const [virtual]

Returns a hash value. This should be overwritten by a subclass that can produce a better hash value.

Reimplemented in ACE_INET_Addr, ACE_MEM_Addr, and ACE_UNIX_Addr.

Definition at line 52 of file Addr.inl.

00053 {
00054   return 0;
00055 }

bool ACE_Addr::operator!= ( const ACE_Addr sap  )  const

Check for address inequality.

Reimplemented in ACE_ATM_Addr, ACE_DEV_Addr, ACE_FILE_Addr, ACE_INET_Addr, ACE_MEM_Addr, ACE_SPIPE_Addr, and ACE_UNIX_Addr.

Definition at line 17 of file Addr.inl.

00018 {
00019   return (sap.addr_type_ != this->addr_type_ ||
00020           sap.addr_size_ != this->addr_size_   );
00021 }

bool ACE_Addr::operator== ( const ACE_Addr sap  )  const

Check for address equality.

Reimplemented in ACE_ATM_Addr, ACE_DEV_Addr, ACE_FILE_Addr, ACE_INET_Addr, ACE_MEM_Addr, ACE_SPIPE_Addr, and ACE_UNIX_Addr.

Definition at line 10 of file Addr.inl.

00011 {
00012   return (sap.addr_type_ == this->addr_type_ &&
00013           sap.addr_size_ == this->addr_size_   );
00014 }

void ACE_Addr::set_addr ( void *  ,
int  len 
) [virtual]

Set a pointer to the address.

Reimplemented in ACE_ATM_Addr, ACE_INET_Addr, ACE_MEM_Addr, ACE_Netlink_Addr, ACE_SPIPE_Addr, and ACE_UNIX_Addr.

Definition at line 45 of file Addr.cpp.

00046 {
00047 }

void ACE_Addr::set_size ( int  size  ) 

Sets the size of the address.

Definition at line 32 of file Addr.inl.

00033 {
00034   this->addr_size_ = size;
00035 }

void ACE_Addr::set_type ( int  type  ) 

Set the type of the address.

Definition at line 46 of file Addr.inl.

00047 {
00048   this->addr_type_ = type;
00049 }


Member Data Documentation

Declare the dynamic allocation hooks.

Reimplemented in ACE_ATM_Addr, ACE_DEV_Addr, ACE_FILE_Addr, ACE_INET_Addr, ACE_MEM_Addr, ACE_Netlink_Addr, ACE_SPIPE_Addr, and ACE_UNIX_Addr.

Definition at line 85 of file Addr.h.

int ACE_Addr::addr_size_ [protected]

Number of bytes in the address.

Definition at line 92 of file Addr.h.

int ACE_Addr::addr_type_ [protected]

e.g., AF_UNIX, AF_INET, AF_SPIPE, etc.

Definition at line 89 of file Addr.h.

const ACE_Addr ACE_Addr::sap_any [static]

Wild-card address.

Definition at line 75 of file Addr.h.


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

Generated on Fri Nov 6 23:20:51 2009 for ACE by  doxygen 1.6.1