ACE 8.0.1
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Attributes | List of all members
ACE_MEM_Addr Class Reference

Defines a C++ wrapper facade for the shared memory transport address family format. More...

#include <MEM_Addr.h>

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

Public Member Functions

 ACE_MEM_Addr ()
 Default constructor.
 
 ACE_MEM_Addr (const ACE_MEM_Addr &)
 Copy constructor.
 
ACE_MEM_Addroperator= (const ACE_MEM_Addr &)=default
 Assignment operator.
 
 ACE_MEM_Addr (u_short port_number)
 Creates an ACE_MEM_Addr from a port_number.
 
 ACE_MEM_Addr (const ACE_TCHAR port_name[])
 Creates an ACE_MEM_Addr from a port_name.
 
 ~ACE_MEM_Addr ()=default
 Default dtor.
 
int initialize_local (u_short port)
 Default initialization routine.
 
int same_host (const ACE_INET_Addr &sap)
 Check if sap designates an endpoint on the same host.
 
int set (u_short port_number, int encode=1)
 
int set (const ACE_TCHAR port_name[])
 
virtual voidget_addr () const
 Return a pointer to the underlying network address.
 
virtual void set_addr (const void *, int len)
 Set a pointer to the address.
 
virtual int addr_to_string (ACE_TCHAR buffer[], size_t size, int ipaddr_format=1) const
 
virtual int string_to_addr (const ACE_TCHAR address[])
 Initializes the external ACE_MEM_Addr from the address.
 
void set_port_number (u_short, int encode=1)
 Sets the port number.
 
u_short get_port_number () const
 Return the port number, converting it into host byte order.
 
int get_host_name (ACE_TCHAR hostname[], size_t hostnamelen) const
 Return the character representation of the hostname.
 
const charget_host_name () const
 Return the character representation of the hostname.
 
const charget_host_addr (char *addr, int addr_size) const
 Return the "dotted decimal" external address.
 
const charget_host_addr () const
 Return the "dotted decimal" external address.
 
ACE_UINT32 get_ip_address () const
 Return the 4-byte IP address, converting it into host byte order.
 
const ACE_INET_Addrget_remote_addr () const
 
const ACE_INET_Addrget_local_addr () const
 
bool operator== (const ACE_MEM_Addr &SAP) const
 Compare two addresses for equality.
 
bool operator== (const ACE_INET_Addr &SAP) const
 
bool operator!= (const ACE_MEM_Addr &SAP) const
 Compare two addresses for inequality.
 
bool operator!= (const ACE_INET_Addr &SAP) const
 
virtual u_long hash () const
 Computes and returns hash value.
 
void dump () const
 Dump the state of an object.
 
- Public Member Functions inherited from ACE_Addr
 ACE_Addr (int type=-1, int size=-1)
 Initializes instance variables.
 
virtual ~ACE_Addr ()=default
 Destructor.
 
int get_size () const
 Return the size of the address.
 
void set_size (int size)
 Sets the size of the address.
 
int get_type () const
 Get the type of the address.
 
void set_type (int type)
 Set the type of 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.
 
void dump () const
 Dump the state of an object.
 

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.
 
- Public Attributes inherited from ACE_Addr
 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.
 

Private Attributes

ACE_INET_Addr external_
 External INET addr used for identifying host.
 
ACE_INET_Addr internal_
 Internal INET addr for accepting/connecting.
 

Additional Inherited Members

- Static Public Attributes inherited from ACE_Addr
static const ACE_Addr sap_any
 Wild-card address.
 
- Protected Attributes inherited from ACE_Addr
int addr_type_
 e.g., AF_UNIX, AF_INET, AF_SPIPE, etc.
 
int addr_size_
 Number of bytes in the address.
 

Detailed Description

Defines a C++ wrapper facade for the shared memory transport address family format.

Constructor & Destructor Documentation

◆ ACE_MEM_Addr() [1/4]

ACE_MEM_Addr::ACE_MEM_Addr ( )

Default constructor.

Transform the current address into string format.

◆ ACE_MEM_Addr() [2/4]

ACE_MEM_Addr::ACE_MEM_Addr ( const ACE_MEM_Addr & sa)

Copy constructor.

◆ ACE_MEM_Addr() [3/4]

ACE_MEM_Addr::ACE_MEM_Addr ( u_short port_number)

Creates an ACE_MEM_Addr from a port_number.

◆ ACE_MEM_Addr() [4/4]

ACE_MEM_Addr::ACE_MEM_Addr ( const ACE_TCHAR port_name[])
explicit

Creates an ACE_MEM_Addr from a port_name.

◆ ~ACE_MEM_Addr()

ACE_MEM_Addr::~ACE_MEM_Addr ( )
default

Default dtor.

Member Function Documentation

◆ addr_to_string()

int ACE_MEM_Addr::addr_to_string ( ACE_TCHAR buffer[],
size_t size,
int ipaddr_format = 1 ) const
virtual

Transform the external ACE_MEM_Addr address into string format.

◆ dump()

void ACE_MEM_Addr::dump ( ) const

Dump the state of an object.

◆ get_addr()

void * ACE_MEM_Addr::get_addr ( ) const
virtual

Return a pointer to the underlying network address.

Return the address.

Reimplemented from ACE_Addr.

◆ get_host_addr() [1/2]

const char * ACE_MEM_Addr::get_host_addr ( ) const
inline

Return the "dotted decimal" external address.

Return the "dotted decimal" external Internet address representation of the hostname. This version is non-reentrant since it returns a pointer to a static data area. You should therefore either (1) do a "deep copy" of the address returned by get_host_addr(), e.g., using strdup() or (2) use the "reentrant" version of get_host_addr() described above.

◆ get_host_addr() [2/2]

const char * ACE_MEM_Addr::get_host_addr ( char * addr,
int addr_size ) const
inline

Return the "dotted decimal" external address.

Return the "dotted decimal" external Internet address representation of the hostname storing it in the addr (which is assumed to be addr_size bytes long). This version is reentrant.

◆ get_host_name() [1/2]

const char * ACE_MEM_Addr::get_host_name ( ) const

Return the character representation of the hostname.

Return the character representation of the hostname (this version is non-reentrant since it returns a pointer to a static data area).

◆ get_host_name() [2/2]

int ACE_MEM_Addr::get_host_name ( ACE_TCHAR hostname[],
size_t hostnamelen ) const

Return the character representation of the hostname.

◆ get_ip_address()

ACE_UINT32 ACE_MEM_Addr::get_ip_address ( ) const
inline

Return the 4-byte IP address, converting it into host byte order.

Return the 4-byte external IP address, converting it into host byte order.

◆ get_local_addr()

const ACE_INET_Addr & ACE_MEM_Addr::get_local_addr ( ) const
inline

◆ get_port_number()

u_short ACE_MEM_Addr::get_port_number ( ) const
inline

Return the port number, converting it into host byte order.

Return the port number.

◆ get_remote_addr()

const ACE_INET_Addr & ACE_MEM_Addr::get_remote_addr ( ) const
inline

◆ hash()

u_long ACE_MEM_Addr::hash ( ) const
virtual

Computes and returns hash value.

Reimplemented from ACE_Addr.

◆ initialize_local()

int ACE_MEM_Addr::initialize_local ( u_short port)

Default initialization routine.

◆ operator!=() [1/2]

bool ACE_MEM_Addr::operator!= ( const ACE_INET_Addr & SAP) const
inline

◆ operator!=() [2/2]

bool ACE_MEM_Addr::operator!= ( const ACE_MEM_Addr & SAP) const
inline

Compare two addresses for inequality.

◆ operator=()

ACE_MEM_Addr & ACE_MEM_Addr::operator= ( const ACE_MEM_Addr & )
default

Assignment operator.

◆ operator==() [1/2]

bool ACE_MEM_Addr::operator== ( const ACE_INET_Addr & SAP) const
inline

◆ operator==() [2/2]

bool ACE_MEM_Addr::operator== ( const ACE_MEM_Addr & SAP) const
inline

Compare two addresses for equality.

Compare two addresses for equality. The addresses are considered equal if they contain the same IP address and port number.

◆ same_host()

int ACE_MEM_Addr::same_host ( const ACE_INET_Addr & sap)

Check if sap designates an endpoint on the same host.

◆ set() [1/2]

int ACE_MEM_Addr::set ( const ACE_TCHAR port_name[])
inline

Uses <getservbyname> to initialize an ACE_MEM_Addr from a port_name, the remote <host_name>, and the <protocol>.

◆ set() [2/2]

int ACE_MEM_Addr::set ( u_short port_number,
int encode = 1 )
inline

Initializes an ACE_MEM_Addr from a port_number. If encode is enabled then port_number is converted into network byte order, otherwise it is assumed to be in network byte order already and are passed straight through.

◆ set_addr()

void ACE_MEM_Addr::set_addr ( const void * addr,
int len )
virtual

Set a pointer to the address.

Reimplemented from ACE_Addr.

◆ set_port_number()

void ACE_MEM_Addr::set_port_number ( u_short port_number,
int encode = 1 )
inline

Sets the port number.

Set the port number.

◆ string_to_addr()

int ACE_MEM_Addr::string_to_addr ( const ACE_TCHAR address[])
virtual

Initializes the external ACE_MEM_Addr from the address.

Member Data Documentation

◆ ACE_ALLOC_HOOK_DECLARE

ACE_MEM_Addr::ACE_ALLOC_HOOK_DECLARE

Declare the dynamic allocation hooks.

◆ external_

ACE_INET_Addr ACE_MEM_Addr::external_
private

External INET addr used for identifying host.

◆ internal_

ACE_INET_Addr ACE_MEM_Addr::internal_
private

Internal INET addr for accepting/connecting.


The documentation for this class was generated from the following files: