Wizard
Software Engineering Project - Wizard
|
#include <unix_address.h>
Public Member Functions | |
unix_address () | |
unix_address (const std::string &path) | |
unix_address (const sockaddr &addr) | |
unix_address (const sock_address &addr) | |
unix_address (const sockaddr_un &addr) | |
unix_address (const unix_address &addr) | |
bool | is_set () const |
std::string | path () const |
socklen_t | size () const override |
const sockaddr * | sockaddr_ptr () const override |
sockaddr * | sockaddr_ptr () override |
const sockaddr_un * | sockaddr_un_ptr () const |
sockaddr_un * | sockaddr_un_ptr () |
std::string | to_string () const |
![]() | |
virtual | ~sock_address () |
virtual sa_family_t | family () const |
Static Public Attributes | |
static constexpr sa_family_t | ADDRESS_FAMILY = AF_UNIX |
static constexpr size_t | MAX_PATH_NAME = 108 |
Class that represents a UNIX domain address. This inherits from the UNIX form of a socket address, sockaddr_un.
|
inline |
Constructs an empty address. The address is initialized to all zeroes.
sockpp::unix_address::unix_address | ( | const std::string & | path | ) |
Constructs an address for the specified path.
path | The |
|
explicit |
Constructs the address by copying the specified structure.
addr | The generic address |
std::invalid_argument | if the address is not a UNIX-domain address (i.e. family is not AF_UNIX) |
|
inline |
Constructs the address by copying the specified structure.
addr | The other address |
|
inline |
Constructs the address by copying the specified structure.
addr | The other address |
std::invalid_argument | if the address is not properly initialized as a UNIX-domain address (i.e. family is not AF_UNIX) |
|
inline |
Constructs the address by copying the specified address.
addr | The other address |
|
inline |
Checks if the address is set to some value. This doesn't attempt to determine if the address is valid, simply that it's not all zero.
|
inline |
Gets the path to which this address refers.
|
inlineoverridevirtual |
Gets the size of the address structure. Note: In this implementation, this should return sizeof(this) but more convenient in some places, and the implementation might change in the future, so it might be more compatible with future revisions to use this call.
Implements sockpp::sock_address.
|
inlineoverridevirtual |
Gets a pointer to this object cast to a const sockaddr.
Implements sockpp::sock_address.
|
inlineoverridevirtual |
Gets a pointer to this object cast to a sockaddr.
Implements sockpp::sock_address.
|
inline |
Gets a pointer to this object cast to a sockaddr_un.
|
inline |
Gets a const pointer to this object cast to a sockaddr_un.
|
inline |
Gets a printable string for the address.
|
staticconstexpr |
The address family for this type of address