32#ifndef RCSC_NET_HOST_ADDRESS_H
33#define RCSC_NET_HOST_ADDRESS_H
54 std::unique_ptr< Impl > M_impl;
Definition: host_address.h:43
void clear()
the host address is set to 0.0.0.0.
bool equals(const HostAddress &addr) const
check if the specified address is same as this object.
bool equals(const AddrType &addr) const
check if the specified address is same as this object.
std::uint16_t PortNumber
port number type
Definition: host_address.h:45
HostAddress(const AddrType &addr)
create a new address object with the argument.
HostAddress()
create a null address object
const HostAddress & operator=(const AddrType &addr)
copy the host address data
~HostAddress()
we need the destructor definition in order to use pimpl idiom with scoped_ptr
const AddrType & toAddress() const
get the raw address object.
HostAddress(const HostAddress &addr)
create a new address object that has same address with the argument.
struct sockaddr_in AddrType
binary ipv4 host address type
Definition: host_address.h:47
const HostAddress & operator=(const HostAddress &addr)
copy the host address data
std::string toHostName() const
get the address as a string (e.g. "127.0.0.1") that is generated by inet_ntoa.
bool isNull() const
check if the host address is 0.0.0.0
void setAddress(const AddrType &addr)
set new address
std::uint32_t IPV4Address
binary ipv4 host address type
Definition: host_address.h:46
IPV4Address toIPV4Address() const
get IPv4 address as a number