![]() SourcePro C++ 13.0 |
SourcePro® C++ API Reference Guide |
Product Documentation: SourcePro C++ Documentation Home |
Interface class that represents a socket address. More...
#include <rw/network/RWSockAddrBase.h>
Public Member Functions | |
| virtual | ~RWSockAddrBase () |
| virtual RWSockType | addressType () const =0 |
| virtual sockaddr * | asSockaddr () const =0 |
| int | getDomain () const |
| int | getFamily () const |
| RWCString | getFamilyName () const |
| int | getProtocol () const |
| int | getType () const |
| virtual RWCString | id (unsigned level=0) const =0 |
| virtual const RWSockAddrBase * | myAddress () const |
| virtual | operator RWCString () const |
| virtual void | prepare () const |
| virtual size_t | sockaddrSize () const =0 |
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 |
Virtual destructor.
|
pure virtual |
Returns the type of address.
Implemented in RWInetAddr, RWInet6Addr, and RWSockAddr.
|
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 RWInetAddr, RWInet6Addr, and RWSockAddr.
| int RWSockAddrBase::getDomain | ( | ) | const |
Alias for getFamily().
| int RWSockAddrBase::getFamily | ( | ) | const |
Returns the integer identifier of the address domain for the socket type, such as AF_INET for an Internet domain.
| 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.
|
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 RWInetAddr, RWInet6Addr, and RWSockAddr.
|
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 |
|
virtual |
Sets up all internal data so that subsequent calls to interfaces on this address do not block.
Reimplemented in RWInetAddr, RWSockAddr, and RWInet6Addr.
|
pure virtual |
Returns the size of an internal representation of the socket address defined by the sockets.
Implemented in RWInetAddr, RWInet6Addr, and RWSockAddr.
|
friend |
Outputs a representation of x on strm. The representation is generated using the member function x.id() with level=0.
Copyright © 2014 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.
Provide feedback to Rogue Wave about its documentation.