join 1.0
lightweight network framework library
Loading...
Searching...
No Matches
join::BasicInternetEndpoint< Protocol > Class Template Reference

basic internet endpoint class. More...

#include <endpoint.hpp>

Inheritance diagram for join::BasicInternetEndpoint< Protocol >:
Collaboration diagram for join::BasicInternetEndpoint< Protocol >:

Public Member Functions

constexpr BasicInternetEndpoint () noexcept
 default constructor.
 
 BasicInternetEndpoint (const struct sockaddr *addr, socklen_t len) noexcept
 create the endpoint instance.
 
 BasicInternetEndpoint (const IpAddress &ip, uint16_t port=0) noexcept
 create the endpoint instance.
 
 BasicInternetEndpoint (const std::string &ip, uint16_t port=0)
 create the endpoint instance.
 
 BasicInternetEndpoint (const char *ip, uint16_t port=0)
 create the endpoint instance.
 
 BasicInternetEndpoint (const Protocol &protocol, uint16_t port=0) noexcept
 create the endpoint instance.
 
void hostname (const std::string &hostname) noexcept
 set endpoint hostname.
 
const std::string & hostname () const noexcept
 get the endpoint hostname.
 
void ip (const IpAddress &ip) noexcept
 set endpoint IP address.
 
IpAddress ip () const noexcept
 get endpoint IP address.
 
void port (uint16_t p) noexcept
 set endpoint port number.
 
uint16_t port () const noexcept
 get endpoint port number.
 
Protocol protocol () const noexcept
 get endpoint protocol.
 
socklen_t length () const noexcept
 get socket address length.
 
void device (const std::string &dev) noexcept
 set endpoint device name.
 
std::string device () const
 get endpoint device name.
 
- Public Member Functions inherited from join::BasicEndpoint< Protocol >
constexpr BasicEndpoint () noexcept
 default constructor.
 
 BasicEndpoint (const struct sockaddr *addr, socklen_t len) noexcept
 create instance using socket address.
 
struct sockaddr * addr () noexcept
 get socket address.
 
const struct sockaddr * addr () const noexcept
 get socket address.
 

Protected Attributes

std::string _hostname
 endpoint hostname.
 
- Protected Attributes inherited from join::BasicEndpoint< Protocol >
struct sockaddr_storage _addr = {}
 socket address storage.
 

Detailed Description

template<class Protocol>
class join::BasicInternetEndpoint< Protocol >

basic internet endpoint class.

Constructor & Destructor Documentation

◆ BasicInternetEndpoint() [1/6]

template<class Protocol >
join::BasicInternetEndpoint< Protocol >::BasicInternetEndpoint ( )
inlineconstexprnoexcept

default constructor.

◆ BasicInternetEndpoint() [2/6]

template<class Protocol >
join::BasicInternetEndpoint< Protocol >::BasicInternetEndpoint ( const struct sockaddr * addr,
socklen_t len )
inlinenoexcept

create the endpoint instance.

Parameters
addrsocket address.

◆ BasicInternetEndpoint() [3/6]

template<class Protocol >
join::BasicInternetEndpoint< Protocol >::BasicInternetEndpoint ( const IpAddress & ip,
uint16_t port = 0 )
inlinenoexcept

create the endpoint instance.

Parameters
ipendpoint IP address.
portendpoint port number.

◆ BasicInternetEndpoint() [4/6]

template<class Protocol >
join::BasicInternetEndpoint< Protocol >::BasicInternetEndpoint ( const std::string & ip,
uint16_t port = 0 )
inline

create the endpoint instance.

Parameters
ipendpoint IP address.
portendpoint port number.

◆ BasicInternetEndpoint() [5/6]

template<class Protocol >
join::BasicInternetEndpoint< Protocol >::BasicInternetEndpoint ( const char * ip,
uint16_t port = 0 )
inline

create the endpoint instance.

Parameters
ipendpoint IP address.
portendpoint port number.

◆ BasicInternetEndpoint() [6/6]

template<class Protocol >
join::BasicInternetEndpoint< Protocol >::BasicInternetEndpoint ( const Protocol & protocol,
uint16_t port = 0 )
inlinenoexcept

create the endpoint instance.

Parameters
protocolendpoint protocol.
portendpoint port number.

Member Function Documentation

◆ device() [1/2]

template<class Protocol >
std::string join::BasicInternetEndpoint< Protocol >::device ( ) const
inline

get endpoint device name.

Returns
endpoint device name.

◆ device() [2/2]

template<class Protocol >
void join::BasicInternetEndpoint< Protocol >::device ( const std::string & dev)
inlinenoexcept

set endpoint device name.

Parameters
devdevice name to set.

◆ hostname() [1/2]

template<class Protocol >
const std::string & join::BasicInternetEndpoint< Protocol >::hostname ( ) const
inlinenoexcept

get the endpoint hostname.

Returns
endpoint hostname.

◆ hostname() [2/2]

template<class Protocol >
void join::BasicInternetEndpoint< Protocol >::hostname ( const std::string & hostname)
inlinenoexcept

set endpoint hostname.

Parameters
hostnamehostname to set.

◆ ip() [1/2]

template<class Protocol >
IpAddress join::BasicInternetEndpoint< Protocol >::ip ( ) const
inlinenoexcept

get endpoint IP address.

Returns
endpoint IP address.

◆ ip() [2/2]

template<class Protocol >
void join::BasicInternetEndpoint< Protocol >::ip ( const IpAddress & ip)
inlinenoexcept

set endpoint IP address.

Parameters
ipip address to set.

◆ length()

template<class Protocol >
socklen_t join::BasicInternetEndpoint< Protocol >::length ( ) const
inlinenoexcept

get socket address length.

Returns
socket address length.

◆ port() [1/2]

template<class Protocol >
uint16_t join::BasicInternetEndpoint< Protocol >::port ( ) const
inlinenoexcept

get endpoint port number.

Returns
endpoint port number.

◆ port() [2/2]

template<class Protocol >
void join::BasicInternetEndpoint< Protocol >::port ( uint16_t p)
inlinenoexcept

set endpoint port number.

Parameters
pport number to set.

◆ protocol()

template<class Protocol >
Protocol join::BasicInternetEndpoint< Protocol >::protocol ( ) const
inlinenoexcept

get endpoint protocol.

Returns
endpoint protocol.

Member Data Documentation

◆ _hostname

template<class Protocol >
std::string join::BasicInternetEndpoint< Protocol >::_hostname
protected

endpoint hostname.


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