BioInt  1.02.00
BioInt: An integrative biological object-oriented application framework and interpreter
BioSocketAddressIn Class Reference

#include <BioSocketAddress.h>

Inheritance diagram for BioSocketAddressIn:
Collaboration diagram for BioSocketAddressIn:

List of all members.

Public Types

enum  address { addr_any = INADDR_ANY, addr_loopback = INADDR_LOOPBACK, addr_broadcast = INADDR_BROADCAST, addr_none = INADDR_NONE }
 Default IPv4 addresses. More...

Public Member Functions

 BioSocketAddressIn () throw ()
 Default constructor.
 BioSocketAddressIn (address _addr, uint16_t _port) throw ()
 Constructor taking a default address and a port.
 BioSocketAddressIn (uint32_t _addr, uint16_t _port) throw ()
 Constructor taking an address and a port.
 BioSocketAddressIn (const std::string &, uint16_t) throw (std::invalid_argument)
 Constructor taking a string argument and a port.
 BioSocketAddressIn (const std::string &) throw (std::invalid_argument)
 Constructor taking a string argument.
bool resolve (const std::string &) throw ()
 Resolves a host name.
bool resolve_port (const std::string &) throw ()
 Convenience method that calls resolve() and port()
bool resolve_port (const std::string &, uint16_t) throw ()
 Convenience method that calls resolve() and port()
bool resolve_port (const std::string &, const std::string &) throw ()
 Convenience method that calls resolve() and port()
uint16_t port () const throw ()
 Get the port.
void port (uint16_t _port) throw ()
 Set the port.
bool port (const std::string &, const std::string &) throw ()
 Set the port using a service name and a protocol name.
bool port (const std::string &) throw ()
 Set the port using a service name.
uint32_t ip () const throw ()
 Get the ip.
void ip (uint32_t _host) throw ()
 Set the ip.
bool ip (const std::string &) throw ()
 Set the ip using a string.
bool ip_port (const std::string &, uint16_t) throw ()
 Convenience method that wraps ip() and port()
bool ip_port (const std::string &) throw ()
 Convenience method that wraps ip() and port()
bool ip_port (const std::string &, const std::string &) throw ()
 Convenience method that wraps ip() and port()
std::string ip_str () const
 Returns a string representation of the ip only.

Static Public Member Functions

static bool validate_addr (const std::string &) throw ()
 Validates a string to see if has the correct "X.X.X.X" format.
static bool validate_addr_port (const std::string &) throw ()
 Validates a string to see if has the correct "X.X.X.X:P" format.

Protected Member Functions

virtual void reset () throw ()
 Resets the internal size to the correct value.

Friends

std::ostream & operator<< (std::ostream &, const BioSocketAddressIn &)
 Operator for printing an address in a stream.
std::istream & operator>> (std::istream &, BioSocketAddressIn &)
 Operator for reading an address from a stream.

Member Enumeration Documentation

Default IPv4 addresses.

Enumerator:
addr_any 

Any.

addr_loopback 

Loopback.

addr_broadcast 

Broadcast.

addr_none 

None.


Constructor & Destructor Documentation

Default constructor.

BioSocketAddressIn::BioSocketAddressIn ( address  _addr,
uint16_t  _port 
) throw ()

Constructor taking a default address and a port.

BioSocketAddressIn::BioSocketAddressIn ( uint32_t  _addr,
uint16_t  _port 
) throw ()

Constructor taking an address and a port.

BioSocketAddressIn::BioSocketAddressIn ( const std::string &  ,
uint16_t   
) throw (std::invalid_argument)

Constructor taking a string argument and a port.

BioSocketAddressIn::BioSocketAddressIn ( const std::string &  ) throw (std::invalid_argument)

Constructor taking a string argument.


Member Function Documentation

uint32_t BioSocketAddressIn::ip ( ) const throw ()

Get the ip.

Here is the caller graph for this function:

void BioSocketAddressIn::ip ( uint32_t  _host) throw ()

Set the ip.

bool BioSocketAddressIn::ip ( const std::string &  ) throw ()

Set the ip using a string.

bool BioSocketAddressIn::ip_port ( const std::string &  ,
uint16_t   
) throw ()

Convenience method that wraps ip() and port()

bool BioSocketAddressIn::ip_port ( const std::string &  ) throw ()

Convenience method that wraps ip() and port()

bool BioSocketAddressIn::ip_port ( const std::string &  ,
const std::string &   
) throw ()

Convenience method that wraps ip() and port()

std::string BioSocketAddressIn::ip_str ( ) const

Returns a string representation of the ip only.

uint16_t BioSocketAddressIn::port ( ) const throw ()

Get the port.

Here is the caller graph for this function:

void BioSocketAddressIn::port ( uint16_t  _port) throw ()

Set the port.

bool BioSocketAddressIn::port ( const std::string &  ,
const std::string &   
) throw ()

Set the port using a service name and a protocol name.

bool BioSocketAddressIn::port ( const std::string &  ) throw ()

Set the port using a service name.

virtual void BioSocketAddressIn::reset ( ) throw () [protected, virtual]

Resets the internal size to the correct value.

Implements BioSocketAddress.

bool BioSocketAddressIn::resolve ( const std::string &  ) throw ()

Resolves a host name.

Here is the caller graph for this function:

bool BioSocketAddressIn::resolve_port ( const std::string &  ) throw ()

Convenience method that calls resolve() and port()

bool BioSocketAddressIn::resolve_port ( const std::string &  ,
uint16_t   
) throw ()

Convenience method that calls resolve() and port()

bool BioSocketAddressIn::resolve_port ( const std::string &  ,
const std::string &   
) throw ()

Convenience method that calls resolve() and port()

static bool BioSocketAddressIn::validate_addr ( const std::string &  ) throw () [static]

Validates a string to see if has the correct "X.X.X.X" format.

static bool BioSocketAddressIn::validate_addr_port ( const std::string &  ) throw () [static]

Validates a string to see if has the correct "X.X.X.X:P" format.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  ,
const BioSocketAddressIn  
) [friend]

Operator for printing an address in a stream.

std::istream& operator>> ( std::istream &  ,
BioSocketAddressIn  
) [friend]

Operator for reading an address from a stream.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines