ANNA Suite  2020b
Multipurpose development suite for Telco applications
Public Member Functions | List of all members
anna::comm::INetAddress Class Reference

#include <INetAddress.hpp>

Public Member Functions

 INetAddress ()
 
 INetAddress (const Device *device, const int port=-1)
 
 INetAddress (const INetAddress &other)
 
const DevicegetDevice (const bool exceptionWhenNull=true) const noexcept(false)
 
int getPort () const
 
void setAddress (const Device *device)
 
void setPort (const int port)
 
INetAddressoperator= (const INetAddress &right)
 
bool operator== (const INetAddress &right) const
 
bool isNull () const
 
void clear ()
 
std::string asString () const
 
std::string serialize () const
 
xml::NodeasXML (xml::Node *parent) const noexcept(false)
 

Detailed Description

Network address abstraction.

Constructor & Destructor Documentation

◆ INetAddress() [1/3]

anna::comm::INetAddress::INetAddress ( )
inline

Constructor.

39 : a_device(NULL), a_port(-1) {}

◆ INetAddress() [2/3]

anna::comm::INetAddress::INetAddress ( const Device device,
const int  port = -1 
)
inline

Constructor.

Parameters
deviceInstance for device (address).
portPort number.
46 : a_device(device), a_port(port) {;}

◆ INetAddress() [3/3]

anna::comm::INetAddress::INetAddress ( const INetAddress other)
inline

Copy constructor.

Parameters
otherSource network address.
52 : a_device(other.a_device) , a_port(other.a_port) {;}

Member Function Documentation

◆ asString()

std::string anna::comm::INetAddress::asString ( ) const

Returns string with relevant information for this instance.

Returns
string with relevant information for this instance.

◆ asXML()

xml::Node* anna::comm::INetAddress::asXML ( xml::Node parent) const
noexcept

Returns XML document with relevant information for this instance.

Parameters
parentXML node from which created data will depend on.
Returns
XML document with relevant information for this instance.

◆ clear()

void anna::comm::INetAddress::clear ( )
inline

Clear the content for this instance.

101 { a_device = NULL; a_port = -1; }

◆ getDevice()

const Device* anna::comm::INetAddress::getDevice ( const bool  exceptionWhenNull = true) const
noexcept

Returns the device (address) associated to this instance.

Parameters
exceptionWhenNullException is launched in case the device returned is NULL.
Returns
Device (address) associated to this instance.

◆ getPort()

int anna::comm::INetAddress::getPort ( ) const
inline

Returns the port associated to this instance.

Returns
Port associated to this instance.
65 { return a_port; }

◆ isNull()

bool anna::comm::INetAddress::isNull ( ) const
inline

Returns the initialized state for this network address.

Returns
true when initialized, false when not.
96 { return (a_device == NULL || a_port == -1); }

◆ operator=()

INetAddress& anna::comm::INetAddress::operator= ( const INetAddress right)
inline

Copy operator.

Parameters
rightSource address to be copied.
83 { a_device = right.a_device; a_port = right.a_port; return *this; }

◆ operator==()

bool anna::comm::INetAddress::operator== ( const INetAddress right) const
inline

Comparison operator.

Parameters
rightSource address to be compared.
Returns
true when address provided is equal to this false in other case.
90 { return a_device == right.a_device && a_port == right.a_port; }

◆ serialize()

std::string anna::comm::INetAddress::serialize ( ) const

Returns string with low-level format relevant information for this instance.

Returns
string with low-level format relevant information for this instance.

◆ setAddress()

void anna::comm::INetAddress::setAddress ( const Device device)
inline

Sets the address for this instance.

Parameters
deviceAddress provided.
71 { a_device = device; }

◆ setPort()

void anna::comm::INetAddress::setPort ( const int  port)
inline

Sets the port for this instance.

Parameters
portPort provided.
77 { a_port = port; }

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