IPV4Address Class Reference

#include <ipv4addr.h>

List of all members.


Detailed Description

IPV4Address encapsulates an IP address, with optional port.

Definition at line 29 of file ipv4addr.h.


Comparison operators

 operator bool () const
bool operator< (const IPV4Address &x, const IPV4Address &y)
bool operator== (const IPV4Address &x, const IPV4Address &y)
bool operator!= (const IPV4Address &x, const IPV4Address &y)

Public Member Functions

Construction and destruction
 IPV4Address (const std::string &addr, uint16_t port=0)
 IPV4Address (uint32_t addr, uint16_t port=0)
 IPV4Address ()
Accessors
uint32_t getAddr () const
uint16_t getPort () const
uint32_t getIp () const
void setAddr (uint32_t addr)
void setPort (uint16_t port)
std::string getStr () const
void setAddr (const std::string &addr)
std::string getAddrStr () const

Private Attributes

uint32_t m_addr
 IP address.
uint16_t m_port
 Port.

Friends

DLLEXPORT std::ostream & operator<< (std::ostream &o, const IPV4Address &a)
 Output operator to streams.

Constructor & Destructor Documentation

IPV4Address::IPV4Address const std::string &  addr,
uint16_t  port = 0
[explicit]
 

Definition at line 46 of file ipv4addr.cpp.

IPV4Address::IPV4Address uint32_t  addr,
uint16_t  port = 0
[explicit]
 

Definition at line 49 of file ipv4addr.cpp.

IPV4Address::IPV4Address  ) 
 

Definition at line 45 of file ipv4addr.cpp.


Member Function Documentation

uint32_t IPV4Address::getAddr  )  const [inline]
 

Definition at line 40 of file ipv4addr.h.

Referenced by SocketClient::connect(), SSocket< Module, Type, Protocol >::getAddr(), UDPSocket::listen(), SocketServer::listen(), and UDPSocket::send().

std::string IPV4Address::getAddrStr  )  const
 

Definition at line 65 of file ipv4addr.cpp.

References Socket::getAddr(), and m_addr.

Here is the call graph for this function:

uint32_t IPV4Address::getIp  )  const [inline]
 

Definition at line 42 of file ipv4addr.h.

uint16_t IPV4Address::getPort  )  const [inline]
 

Definition at line 41 of file ipv4addr.h.

Referenced by SocketClient::connect(), UDPSocket::listen(), SocketServer::listen(), and UDPSocket::send().

std::string IPV4Address::getStr  )  const
 

Definition at line 56 of file ipv4addr.cpp.

References m_addr, and m_port.

IPV4Address::operator bool  )  const [inline]
 

Definition at line 76 of file ipv4addr.h.

void IPV4Address::setAddr const std::string &  addr  ) 
 

Definition at line 69 of file ipv4addr.cpp.

References m_addr, and Socket::makeAddr().

Here is the call graph for this function:

void IPV4Address::setAddr uint32_t  addr  )  [inline]
 

Definition at line 43 of file ipv4addr.h.

Referenced by UDPSocket::listen(), SocketServer::listen(), and UDPSocket::recv().

void IPV4Address::setPort uint16_t  port  )  [inline]
 

Definition at line 44 of file ipv4addr.h.

Referenced by UDPSocket::recv().


Friends And Related Function Documentation

bool operator!= const IPV4Address x,
const IPV4Address y
[friend]
 

Definition at line 73 of file ipv4addr.h.

bool operator< const IPV4Address x,
const IPV4Address y
[friend]
 

Definition at line 63 of file ipv4addr.h.

DLLEXPORT std::ostream& operator<< std::ostream &  o,
const IPV4Address a
[friend]
 

Output operator to streams.

Definition at line 52 of file ipv4addr.cpp.

bool operator== const IPV4Address x,
const IPV4Address y
[friend]
 

Definition at line 70 of file ipv4addr.h.


Member Data Documentation

uint32_t IPV4Address::m_addr [private]
 

IP address.

Definition at line 79 of file ipv4addr.h.

Referenced by getAddrStr(), getStr(), and setAddr().

uint16_t IPV4Address::m_port [private]
 

Port.

Definition at line 80 of file ipv4addr.h.

Referenced by getStr().


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