ipaddress Class Reference

Representation of an IPv4 address. More...

#include <ipaddress.h>

List of all members.

Public Member Functions

 ipaddress (void)
 ipaddress (unsigned int o)
 ipaddress (int o)
 ipaddress (const string &o)
 ipaddress (const char *o)
 ipaddress (const ipaddress &o)
 ipaddress (const value &o)
 ~ipaddress (void)
ipaddressoperator= (const ipaddress &o)
ipaddressoperator= (const value &v)
ipaddressoperator= (int i)
ipaddressoperator= (const char *c)
 operator unsigned int (void) const
ipaddressoperator++ (int i)
ipaddressoperator-- (int i)
ipaddressoperator+= (const ipaddress &o)
ipaddressoperator-= (const ipaddress &o)
ipaddressoperator&= (const ipaddress &o)
ipaddressoperator|= (const ipaddress &o)
bool operator== (int o) const
bool operator!= (int o) const
bool operator== (unsigned int o) const
bool operator!= (unsigned int o) const
bool operator== (const value &o) const
bool operator!= (const value &o) const
bool operator== (const ipaddress &o) const
bool operator!= (const ipaddress &o) const

Protected Attributes

unsigned int addr

Detailed Description

Representation of an IPv4 address.

This class is meant to be passed-by-value. It only contains a single unsigned int and mainly acts as a convenient type- indicator when handling with ip-addresses in the context of value objects, for different encoding standards where there needs to be a choice between writing an integer (shox, SQL) or a string (XML). A plain unsigned int doesn't have those needs and it is hard to dinstinguish the two if an ipaddress where just a typedef. The constructors and operators implemented should make this a drop-in replacement for wielding sockaddr_in or unsigned ints.


Constructor & Destructor Documentation

ipaddress::ipaddress ( void   )  [inline]

Default constructor.

Sets the value to 0.0.0.0

References addr.

ipaddress::ipaddress ( const char *  o  )  [inline]

Constructor from a c-string.

Needed because gcc can't figure out whether to cast it to value or string otherwise. Where's pragma this_one_bitch when you need it?.

References addr.

ipaddress::ipaddress ( const value o  )  [inline]

Constructor from a value.

Just calls ipval().

References addr, and value::ipval().

Here is the call graph for this function:


Member Function Documentation

ipaddress& ipaddress::operator++ ( int  i  )  [inline]

Increment operator.

Todo:
Implement prefix/postfix properly.

References addr.

ipaddress& ipaddress::operator-- ( int  i  )  [inline]

Decrement operator.

Todo:
Implement prefix/postfix properly.

References addr.

ipaddress& ipaddress::operator= ( const ipaddress o  )  [inline]

Assignment operator.

Parameters:
o The original.

References addr.


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

Generated on Sun Feb 28 10:36:07 2010 for GRACE by  doxygen 1.6.1