SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Interface class that represents a socket address. More...
#include <rw/network/RWSockAddrBase.h>
Public Member Functions | |
virtual | ~RWSockAddrBase () |
virtual void | prepare () const |
virtual RWSockType | addressType () const =0 |
RWCString | getFamilyName () const |
int | getFamily () const |
int | getDomain () const |
int | getType () const |
int | getProtocol () const |
virtual sockaddr * | asSockaddr () const =0 |
virtual size_t | sockaddrSize () const =0 |
virtual | operator RWCString () const |
virtual RWCString | id (unsigned level=0) const =0 |
virtual const RWSockAddrBase * | myAddress () const |
Friends | |
std::ostream & | operator<< (std::ostream &strm, const RWSockAddrBase &x) |
RWSockAddrBase is an interface class that represents a socket address. All member functions are virtual. The class RWSockAddr is a proxy class that provides an interface to an RWSockAddrBase object whose exact type can be known only at run time.
virtual RWSockAddrBase::~RWSockAddrBase | ( | ) | [virtual] |
Virtual destructor.
virtual RWSockType RWSockAddrBase::addressType | ( | ) | const [pure virtual] |
Returns the type of address.
Implemented in RWInet6Addr, RWInetAddr, and RWSockAddr.
virtual sockaddr* RWSockAddrBase::asSockaddr | ( | ) | const [pure virtual] |
Returns a pointer to an internal representation of the address cast to a sockaddr
structure, as defined by the sockets and TLI APIs (TLI is the Unix System V network communication interface). The pointer points to an internal data structure, so it becomes invalid if this object is changed in any way or goes out of scope. If the address has no representation as a sockaddr
, a null pointer is returned. These operations may block if prepare() has not been called.
Implemented in RWInet6Addr, RWInetAddr, and RWSockAddr.
int RWSockAddrBase::getDomain | ( | ) | const |
Returns the integer identifier of the address domain for the socket type, such as AF_INET
for an Internet domain. getFamily() and getDomain() are synonyms.
int RWSockAddrBase::getFamily | ( | ) | const |
Returns the integer identifier of the address domain for the socket type, such as AF_INET
for an Internet domain. getFamily() and getDomain() are synonyms.
RWCString RWSockAddrBase::getFamilyName | ( | ) | const |
Gets the socket family name. The RWCString should contain 7-bit US-ASCII data.
int RWSockAddrBase::getProtocol | ( | ) | const |
Gets the socket protocol.
int RWSockAddrBase::getType | ( | ) | const |
Gets the socket address type.
virtual RWCString RWSockAddrBase::id | ( | unsigned | level = 0 |
) | const [pure virtual] |
Returns a string describing self
. The verbosity of the output is controlled by level where level=0
is the most basic output, and level=9
is the most verbose. The RWCString should contain 7-bit US-ASCII data.
Implemented in RWInet6Addr, RWInetAddr, and RWSockAddr.
virtual const RWSockAddrBase* RWSockAddrBase::myAddress | ( | ) | const [virtual] |
Used by derived classes to implement narrowing conversions from an RWSockAddr or an RWSockAddrBase to a derived address type. It returns this
, unless this
address is a proxy, in which case it returns the pointer to the base class of the object being proxied.
Reimplemented in RWSockAddr.
virtual RWSockAddrBase::operator RWCString | ( | ) | const [virtual] |
virtual void RWSockAddrBase::prepare | ( | ) | const [virtual] |
Sets up all internal data so that subsequent calls to interfaces on this address do not block.
Reimplemented in RWInet6Addr, RWInetAddr, and RWSockAddr.
virtual size_t RWSockAddrBase::sockaddrSize | ( | ) | const [pure virtual] |
Returns the size of an internal representation of the socket address defined by the sockets.
Implemented in RWInet6Addr, RWInetAddr, and RWSockAddr.
std::ostream& operator<< | ( | std::ostream & | strm, | |
const RWSockAddrBase & | x | |||
) | [friend] |
Outputs a representation of x on strm. The representation is generated using the member function x.id() with level=0
.
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.