conexus logo

Conexus::IPv4::IP Class Reference
[IPv4 EndpointsConexus I/O Endpoints]

This class serves as the base class for all IPv4 communication classes. More...

#include <ipv4_ip.h>

Inheritance diagram for Conexus::IPv4::IP:

Inheritance graph
[legend]

List of all members.

Public Types

typedef ConexusPointer< IPpointer
 Class typedef to smart pointer.

Public Member Functions

virtual ~IP () throw ()
virtual void bind () throw ( bind_exception )
 Binds to the local address.
virtual void bind (const Conexus::Address &a) throw ( bind_exception )
 Sets the local address to.
virtual void connect () throw ( connect_exception )
 Connects to the remote address.
virtual void connect (const Address &a) throw ( connect_exception )
 Sets the remote address to.
virtual Addresslocal_address ()
 Returns the current local address.
virtual Addressremote_address ()
 Returns the current remote address.
virtual IPAddressInterfacegeneric_local_address ()
virtual IPAddressInterfacegeneric_remote_address ()
virtual void set_remote_address (const Address &addr)
virtual void set_remote_address (uint32_t addr, uint16_t port)
virtual void set_remote_address (const std::string &addr, uint16_t port)
virtual void unset_remote_address ()
virtual void set_local_address (const Address &addr)
virtual void set_local_address (uint32_t addr, uint16_t port)
virtual void set_local_address (const std::string &addr, uint16_t port)

Protected Member Functions

 IP (int type=-1, int protocol=0)
 Default constructor which sets the socket domain to PF_INET but does not provide a socket type or protocol.
virtual void on_local_address_changed ()
virtual void on_remote_address_changed ()
void on_local_address_changed_proxy ()
void on_remote_address_changed_proxy ()

Protected Attributes

Address m_local_address
Address m_remote_address
bool m_remote_address_set


Detailed Description

This class serves as the base class for all IPv4 communication classes.

All child classes such as UDP and TCP inherit the association of a local host address from this class as well as the concept of interface association, multicasting capabilities and of course, ports.

This class also stores an internal address object representing a local interface object. All BSD socket API functions (such as bind) that require a sockaddr_in structure will be provided this internal attribute. Therefore, it is the responsibility of children such as UDP and TCP to make the appropriate modifications to this protected attribute.

Author:
Rick L Vinyard Jr <rvinyard@cs.nmsu.edu>

Member Typedef Documentation

typedef ConexusPointer<IP> Conexus::IPv4::IP::pointer

Class typedef to smart pointer.

Reimplemented from Conexus::IP.

Reimplemented in Conexus::IPv4::TCP, Conexus::IPv4::UDP, Conexus::IPv4::UDPPoset, Conexus::SSL::IPv4::TCP, and Conexus::SSL::IPv4::UDP.


Constructor & Destructor Documentation

Conexus::IPv4::IP::IP ( int  type = -1,
int  protocol = 0 
) [protected]

Default constructor which sets the socket domain to PF_INET but does not provide a socket type or protocol.

References m_local_address, m_remote_address, on_local_address_changed_proxy(), on_remote_address_changed_proxy(), and Conexus::IPv4::Address::signal_changed().

Conexus::IPv4::IP::~IP (  )  throw () [virtual]

Reimplemented from Conexus::IP.


Member Function Documentation

void Conexus::IPv4::IP::bind ( const Conexus::Address a  )  throw ( bind_exception ) [virtual]

Sets the local address to.

Parameters:
a and binds to the local address.

Reimplemented from Conexus::Socket.

Reimplemented in Conexus::IPv4::UDP, and Conexus::IPv4::UDPPoset.

References Conexus::Socket::bind().

void Conexus::IPv4::IP::bind (  )  throw ( bind_exception ) [virtual]

Binds to the local address.

Reimplemented from Conexus::Socket.

Reimplemented in Conexus::IPv4::UDP, and Conexus::IPv4::UDPPoset.

References m_local_address.

Referenced by Conexus::IPv4::UDPPoset::bind(), and Conexus::IPv4::UDP::bind().

void Conexus::IPv4::IP::connect ( const Address a  )  throw ( connect_exception ) [virtual]

Sets the remote address to.

Parameters:
a and connects to the remote address

Reimplemented in Conexus::IPv4::UDP, Conexus::IPv4::UDPPoset, Conexus::SSL::IPv4::TCP, and Conexus::SSL::IPv4::UDP.

References Conexus::Socket::connect().

void Conexus::IPv4::IP::connect (  )  throw ( connect_exception ) [virtual]

IPAddressInterface & Conexus::IPv4::IP::generic_local_address (  )  [virtual]

Implements Conexus::IP.

References m_local_address.

IPAddressInterface & Conexus::IPv4::IP::generic_remote_address (  )  [virtual]

Implements Conexus::IP.

References m_remote_address.

Address & Conexus::IPv4::IP::local_address (  )  [virtual]

Returns the current local address.

References m_local_address.

void Conexus::IPv4::IP::on_local_address_changed (  )  [protected, virtual]

void Conexus::IPv4::IP::on_local_address_changed_proxy (  )  [protected]

References on_local_address_changed().

Referenced by IP().

void Conexus::IPv4::IP::on_remote_address_changed (  )  [protected, virtual]

void Conexus::IPv4::IP::on_remote_address_changed_proxy (  )  [protected]

References m_remote_address_set, and on_remote_address_changed().

Referenced by IP().

Address & Conexus::IPv4::IP::remote_address (  )  [virtual]

Returns the current remote address.

References m_remote_address.

void Conexus::IPv4::IP::set_local_address ( const std::string &  addr,
uint16_t  port 
) [virtual]

References m_local_address.

void Conexus::IPv4::IP::set_local_address ( uint32_t  addr,
uint16_t  port 
) [virtual]

References m_local_address.

void Conexus::IPv4::IP::set_local_address ( const Address addr  )  [virtual]

References m_local_address.

void Conexus::IPv4::IP::set_remote_address ( const std::string &  addr,
uint16_t  port 
) [virtual]

void Conexus::IPv4::IP::set_remote_address ( uint32_t  addr,
uint16_t  port 
) [virtual]

void Conexus::IPv4::IP::set_remote_address ( const Address addr  )  [virtual]

void Conexus::IPv4::IP::unset_remote_address (  )  [virtual]


Member Data Documentation


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

Generated on Wed Jul 8 15:51:27 2009 for conexus by doxygen 1.5.8