BioInt
1.02.00
BioInt: An integrative biological object-oriented application framework and interpreter
|
#include <BioSocketAddress.h>
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. |
BioSocketAddressIn::BioSocketAddressIn | ( | ) | throw () |
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.
uint32_t BioSocketAddressIn::ip | ( | ) | const throw () |
Get the ip.
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 () |
bool BioSocketAddressIn::ip_port | ( | const std::string & | ) | throw () |
bool BioSocketAddressIn::ip_port | ( | const std::string & | , |
const std::string & | |||
) | throw () |
std::string BioSocketAddressIn::ip_str | ( | ) | const |
Returns a string representation of the ip only.
uint16_t BioSocketAddressIn::port | ( | ) | const throw () |
Get the port.
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.
bool BioSocketAddressIn::resolve_port | ( | const std::string & | ) | throw () |
bool BioSocketAddressIn::resolve_port | ( | const std::string & | , |
uint16_t | |||
) | throw () |
bool BioSocketAddressIn::resolve_port | ( | const std::string & | , |
const std::string & | |||
) | throw () |
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.
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.