Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

strmod::ehnet::SocketAddress Class Reference

C++ class wrapper for struct ::sockaddr from sys/socket.h. More...

#include <EHnet++/SocketAddress.h>

Inheritance diagram for strmod::ehnet::SocketAddress:

Inheritance graph
[legend]
List of all members.

Public Methods

 SocketAddress ()
 An abstract SocketAddress really doesn't have any parameters.

virtual ~SocketAddress ()
 No member variables, nothing to do.

virtual int AreYouA (const lcore::ClassIdent &cid) const
 Asks if a class is of a particular type, or publicly derived from that type.

virtual void PrintOn (::std::ostream &)
 Send a textual representation of the address to the given ostream.

virtual::sockaddr * SockAddr ()=0
 Get the sockaddr struct this object is wrapping.

SocketAddress * Copy () const
 Clone this address, no matter it's actual type.

virtual int AddressSize () const=0
 How long is this address in memory?

virtual::std::string AsString ()=0
 Fetch a string representation of the SocketAddress.


Static Public Attributes

const NET_ClassIdent identifier
 Globally unique identifier for this class.


Protected Methods

virtual const lcore::ClassIdent * i_GetIdent () const
 Returns the class identifier for the class the object actually is.

virtual SocketAddress * MakeCopy () const=0
 Clone this address, no matter it's actual type.


Detailed Description

C++ class wrapper for struct ::sockaddr from sys/socket.h.

This is a C++ wrapper for the sockaddr structure that the connect, and bind system calls take. It includes a virtual 'Copy' method to clone copies when you don't know the actual type of the address.

Definition at line 80 of file SocketAddress.h.


Member Function Documentation

virtual int strmod::ehnet::SocketAddress::AreYouA const lcore::ClassIdent &    cid const [inline, virtual]
 

Asks if a class is of a particular type, or publicly derived from that type.

Overriden in every derived class (with a static identifier member) to compare against the identifier, then call the AreYouA methods of all the superclasses.

Parameters:
cid Usually <class>::identifier for the class you want to ask if the object is an instance of.

Reimplemented from strmod::lcore::Protocol.

Definition at line 90 of file SocketAddress.h.

SocketAddress* strmod::ehnet::SocketAddress::Copy   const [inline]
 

Clone this address, no matter it's actual type.

This is a non-virtual for compilers that don't support contravariance in the return types of virtual functions.

Reimplemented in strmod::ehnet::InetAddress.

Definition at line 104 of file SocketAddress.h.

virtual const lcore::ClassIdent* strmod::ehnet::SocketAddress::i_GetIdent   const [inline, protected, virtual]
 

Returns the class identifier for the class the object actually is.

Should always be overridden in any class that has a static identifier member.

Reimplemented from strmod::lcore::Protocol.

Reimplemented in strmod::ehnet::InetAddress.

Definition at line 111 of file SocketAddress.h.


Member Data Documentation

const NET_ClassIdent strmod::ehnet::SocketAddress::identifier [static]
 

Globally unique identifier for this class.

Every class that might need to be identified should have a public static const identifier object in it.

Reimplemented from strmod::lcore::Protocol.

Reimplemented in strmod::ehnet::InetAddress.


The documentation for this class was generated from the following files:
Generated on Wed Jan 29 00:32:47 2003 for libNet by doxygen1.3-rc1