i6engine  1.0
i6e::core::IPKey Class Reference

#include <D:/Projekte/i6engine/libs/i6engine-core/include/i6engine/core/messaging/IPKey.h>

Classes

class  Hash
 

Public Member Functions

 IPKey ()
 default constructor, constructs an invalid Key More...
 
 IPKey (const std::string &ip, uint16_t port)
 constructor taking ip and port to create a key More...
 
 IPKey (const std::string &str)
 constructor taking a string More...
 
 ~IPKey ()
 destructor More...
 
bool operator== (const IPKey &other) const
 operator to compare two keys More...
 
bool operator!= (const IPKey &other) const
 
std::string getIP () const
 returns the ip of the key More...
 
uint16_t getPort () const
 returns the port of the key More...
 
bool isValid () const
 Returns true if this is a valid IP/Port combination. More...
 
std::string toString () const
 Returns the string representation of this IPKey. More...
 

Friends

class boost::serialization::access
 
ISIXE_CORE_API std::ostream & operator<< (std::ostream &stream, const IPKey &key)
 

Detailed Description

Represents the IP and Port of a PC. This class is used to identify the clients.

Definition at line 52 of file IPKey.h.

Constructor & Destructor Documentation

i6e::core::IPKey::IPKey ( )
inline

default constructor, constructs an invalid Key

Definition at line 60 of file IPKey.h.

i6e::core::IPKey::IPKey ( const std::string &  ip,
uint16_t  port 
)

constructor taking ip and port to create a key

i6e::core::IPKey::IPKey ( const std::string &  str)
explicit

constructor taking a string

Parameters
[in]strformatted like ip:port
i6e::core::IPKey::~IPKey ( )
inline

destructor

Definition at line 77 of file IPKey.h.

Member Function Documentation

std::string i6e::core::IPKey::getIP ( ) const

returns the ip of the key

uint16_t i6e::core::IPKey::getPort ( ) const
inline

returns the port of the key

Definition at line 93 of file IPKey.h.

bool i6e::core::IPKey::isValid ( ) const

Returns true if this is a valid IP/Port combination.

This method only does a simple check for an empty IP and for an Port = 0. An default constructed IPKey is never valid.

bool i6e::core::IPKey::operator!= ( const IPKey other) const
bool i6e::core::IPKey::operator== ( const IPKey other) const

operator to compare two keys

std::string i6e::core::IPKey::toString ( ) const

Returns the string representation of this IPKey.

Returns IP:Port if this is a valid IP and "Invalid IP" otherwise

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Definition at line 53 of file IPKey.h.

ISIXE_CORE_API std::ostream& operator<< ( std::ostream &  stream,
const IPKey key 
)
friend

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