NetCpp  v0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Macros Pages
address Class Reference

Address for IPv4 TCP communications. More...

#include <tcp_ip4.hpp>

Inheritance diagram for address:
Inheritance graph

Public Member Functions

 address (const std::string &addr, int port)
 Constructor.
std::string getAddress () const
 Get the address.
int getPort () const
 Get the port number.

Private Attributes

std::string address_
 IP address.
int port_
 Port number.

Detailed Description

Address for IPv4 TCP communications.

Definition at line 43 of file tcp_ip4.hpp.

Constructor & Destructor Documentation

address ( const std::string &  addr,
int  port 
)
inline

Constructor.

Parameters
addrstd::string containing the address (e.g., "127.0.0.1")
portInteger containing the port number (e.g., 1234)

Definition at line 51 of file tcp_ip4.hpp.

:
address_{addr}, port_{port}{};

Member Function Documentation

std::string getAddress ( ) const
inlinevirtual

Get the address.

Returns
a std::string containing the IP address (not the port number)

Implements Address.

Definition at line 60 of file tcp_ip4.hpp.

{
return address_;
}
int getPort ( ) const
inline

Get the port number.

Returns
an integer containing the port number

Definition at line 69 of file tcp_ip4.hpp.

{
return port_;
}

Member Data Documentation

std::string address_
private

IP address.

Definition at line 75 of file tcp_ip4.hpp.

int port_
private

Port number.

Definition at line 78 of file tcp_ip4.hpp.


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