xvr2::Net::IPv4Address Class Reference

#include <xvr2/Net/IPv4Address.h>

Inheritance diagram for xvr2::Net::IPv4Address:

Inheritance graph
[legend]

List of all members.


Detailed Description

This class represents a classic IPv4 address, there are several ways to build an ipv4 address from a String or even by each one of its octets.

Definition at line 37 of file IPv4Address.h.


Public Member Functions

 IPv4Address ()
 Default constructor, use it when you'll be needing a variable for copying the contents of another IPv4Address object.
 IPv4Address (const String &ip_or_host)
 Constructs an IPv4Address instance given by a string representation of an ip v4 formatted address or a DNS resolvable hostname.
 IPv4Address (UInt8 a, UInt8 b, UInt8 c, UInt8 d)
 Builds an IPv4Address object from its 4 octets a.b.c.d.
 IPv4Address (const IPv4Address &ip)
 Copy contructor.
 IPv4Address (const struct::in_addr *x_addr)
 Standard C-library interface contructor.
 IPv4Address (const struct::in_addr &x_addr)
 Standard C-library interface contructor.
 ~IPv4Address ()
 Mandatory destructor.
IPv4Addressoperator= (const struct::in_addr *_addr)
 Standard C-library interface assigment method.
IPv4Addressoperator= (const struct::in_addr &_addr)
 Standard C-library interface assigment method.
struct::in_addr * address () const
std::string toString ()
virtual const char * getClassName ()
 Returns the name of the current class.

Static Public Member Functions

static void debugmsg (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__)
 Will print a debug message to the screen.
static void debugmsgln (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__)

Protected Attributes

struct::in_addr addr
 Internal OS dependent internet space address representation.
std::string __cls_name

Friends

std::ostream & operator<< (std::ostream &stream, const IPv4Address &s)
std::ostream & operator<< (std::ostream &stream, const Object &s)

Constructor & Destructor Documentation

xvr2::Net::IPv4Address::IPv4Address (  ) 

Default constructor, use it when you'll be needing a variable for copying the contents of another IPv4Address object.

xvr2::Net::IPv4Address::IPv4Address ( const String ip_or_host  ) 

Constructs an IPv4Address instance given by a string representation of an ip v4 formatted address or a DNS resolvable hostname.

During its construction this class will build its internal OS-dependent representation by issuing a DNS query in order to obtain a valid IP version 4 formatted address for the given argument.

Parameters:
ip_or_host IP address or hostname from where we will be building the address.

xvr2::Net::IPv4Address::IPv4Address ( UInt8  a,
UInt8  b,
UInt8  c,
UInt8  d 
)

Builds an IPv4Address object from its 4 octets a.b.c.d.

xvr2::Net::IPv4Address::IPv4Address ( const IPv4Address ip  ) 

Copy contructor.

It initializes its internal vars from the given IPv4Address object given as argument.

Parameters:
ip An IPv4Address object from where to copy.

xvr2::Net::IPv4Address::IPv4Address ( const struct::in_addr *  x_addr  ) 

Standard C-library interface contructor.

Will instantiate an IPv4Address object from the given internet address using the platform specific data object.

Parameters:
x_addr An IPv4 internet address.

xvr2::Net::IPv4Address::IPv4Address ( const struct::in_addr &  x_addr  ) 

Standard C-library interface contructor.

Will instantiate an IPv4Address object from the given internet address using the platform specific data object.

Parameters:
x_addr An IPv4 internet address.

xvr2::Net::IPv4Address::~IPv4Address (  ) 

Mandatory destructor.


Member Function Documentation

IPv4Address& xvr2::Net::IPv4Address::operator= ( const struct::in_addr *  _addr  ) 

Standard C-library interface assigment method.

Will instantiate an IPv4Address object from the given internet address using the platform specific data object.

Parameters:
_addr An IPv4 internet address.

IPv4Address& xvr2::Net::IPv4Address::operator= ( const struct::in_addr &  _addr  ) 

Standard C-library interface assigment method.

Will instantiate an IPv4Address object from the given internet address using the platform specific data object.

Parameters:
_addr An IPv4 internet address.

struct ::in_addr* xvr2::Net::IPv4Address::address (  )  const [read]

std::string xvr2::Net::IPv4Address::toString (  )  [virtual]

Reimplemented from xvr2::Object.

virtual const char* xvr2::Object::getClassName (  )  [virtual, inherited]

Returns the name of the current class.

static void xvr2::Object::debugmsg ( Object obj,
const char *  msg,
int  linenumber = __LINE__,
const char *  srcfile = __FILE__ 
) [static, inherited]

Will print a debug message to the screen.

static void xvr2::Object::debugmsgln ( Object obj,
const char *  msg,
int  linenumber = __LINE__,
const char *  srcfile = __FILE__ 
) [static, inherited]


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const IPv4Address s 
) [friend]

std::ostream& operator<< ( std::ostream &  stream,
const Object s 
) [friend, inherited]


Member Data Documentation

struct ::in_addr xvr2::Net::IPv4Address::addr [protected]

Internal OS dependent internet space address representation.

Definition at line 41 of file IPv4Address.h.

std::string xvr2::Object::__cls_name [protected, inherited]

Definition at line 30 of file Object.h.


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

Generated on Fri Jun 20 22:56:00 2008 for X-VR2 SDK by  doxygen 1.5.5