mxmIPAddress Class Reference
[modularMX Runtime Platform Core]

IP address, including port specification if desired. More...

#include <mxmIPAddress.h>

Inheritance diagram for mxmIPAddress:

mxmObject List of all members.

Public Member Functions

 mxmIPAddress ()
 Initializes as null-IP, which is 0.0.0.0, no port.
 mxmIPAddress (int ip1, int ip2, int ip3, int ip4, int port=NoPort)
 Initializes as specified IP4 address, including port if given.
 mxmIPAddress (const mxmString &hostName)
 Initializes from the specified host name.
 mxmIPAddress (const mxmIPAddress &ip)
 Copy constructor.
mxmIPAddressoperator= (const mxmIPAddress &ip)
 Assignment.
mxmIPAddressoperator= (const mxmString &hostName)
 Assignment.
bool operator== (const mxmIPAddress &ip) const
 Comparison.
bool operator!= (const mxmIPAddress &ip) const
 Negated Comparison.
bool sameHost (const mxmIPAddress &ip) const
 Comparison like above, but ignoring the port settings.
void setPort (int port)
 Reconfigures port information, mxmIPAddress::NoPort unsets port.
int ip1 () const
int ip2 () const
int ip3 () const
int ip4 () const
int port () const
bool resolved () const
mxmString toString () const
 Returns string representation in form of ip1.ip2.ip3.ip4[:port]
  • in case of an unresolvable address this would be "0.0.0.0".

bool resolve () const
 Explicitly triggers DNS resolving.

Static Public Member Functions

static mxmIPAddress nullIP ()
 Returns a nully-IP.

Static Public Attributes

static const int NoPort = -1
static const int PortMax = 65535

Private Member Functions

void initCommonStuff ()
void setFromNetwork (mxm::u32 networkOrderIp)
 Uses ntohl() to properly convert the byte order - the port setting is cleared.

Private Attributes

int IP1
int IP2
int IP3
int IP4
int Port
mxmString HostName
bool Resolved
void * StableABIDataExtension

Detailed Description

IP address, including port specification if desired.

This implementation is a join of the obsoleted mxcpcIPAddress and the former mxmIPAddress that was developed on the camera.

The class does lazy DNS lookup automatically, i.e. the address is resolved exactly once, when the data is used. To force the DNS lookup the resolve() method can be used.

There is a special value named null-IP, being nonsensical 0.0.0.0, no port. It can be conveniently used in APIs to denote "no IP set".

Note:
The WSAStartup() / WSACleanup() hazzle on the Windows platform is currently transparently taken care of by mxmIPAddress.


Member Function Documentation

bool mxmIPAddress::operator== const mxmIPAddress ip  )  const
 

Comparison.

A comparison with unresolvable addresses involved always returns false.

Note:
If you intend to only compare the host part, ignoring the port setting, use sameHost().

bool mxmIPAddress::resolve  )  const
 

Explicitly triggers DNS resolving.

If the address is already resolved, the method does nothing.

Returns:
true in case the address is properly resolved upon return, and false otherwise

void mxmIPAddress::setPort int  port  ) 
 

Reconfigures port information, mxmIPAddress::NoPort unsets port.

Only works for resolvable addresses.


The documentation for this class was generated from the following files:
Generated on Fri Jun 29 17:21:04 2007 for MxPEG SDK by  doxygen 1.4.6