MySQL 8.3.0
Source Code Documentation
local::basic_endpoint< Protocol > Class Template Reference

endpoint of Unix domain sockets (AF_UNIX). More...

#include <local.h>

Public Types

using protocol_type = Protocol
 

Public Member Functions

constexpr basic_endpoint () noexcept
 
 basic_endpoint (std::string_view path)
 
constexpr protocol_type protocol () const noexcept
 
std::string path () const
 get path. More...
 
const void * data () const noexcept
 
void * data () noexcept
 
constexpr size_t size () const noexcept
 bytes used data(). More...
 
constexpr size_t capacity () const noexcept
 
void resize (size_t n) noexcept
 resize data(). More...
 

Private Member Functions

constexpr size_t max_path_len () const
 

Private Attributes

sockaddr_un data_
 
size_t path_len_ {0}
 

Detailed Description

template<typename Protocol>
class local::basic_endpoint< Protocol >

endpoint of Unix domain sockets (AF_UNIX).

path may be:

  • empty (unnamed sockets, aka 'autobind' on Linux)
  • start with NUL-byte (abstract sockets, no file, used for socketpair())
  • a path

Member Typedef Documentation

◆ protocol_type

Constructor & Destructor Documentation

◆ basic_endpoint() [1/2]

template<typename Protocol >
constexpr local::basic_endpoint< Protocol >::basic_endpoint ( )
inlineconstexprnoexcept

◆ basic_endpoint() [2/2]

template<typename Protocol >
local::basic_endpoint< Protocol >::basic_endpoint ( std::string_view  path)
inline

Member Function Documentation

◆ capacity()

template<typename Protocol >
constexpr size_t local::basic_endpoint< Protocol >::capacity ( ) const
inlineconstexprnoexcept

◆ data() [1/2]

template<typename Protocol >
const void * local::basic_endpoint< Protocol >::data ( ) const
inlinenoexcept

◆ data() [2/2]

template<typename Protocol >
void * local::basic_endpoint< Protocol >::data ( )
inlinenoexcept

◆ max_path_len()

template<typename Protocol >
constexpr size_t local::basic_endpoint< Protocol >::max_path_len ( ) const
inlineconstexprprivate

◆ path()

template<typename Protocol >
std::string local::basic_endpoint< Protocol >::path ( ) const
inline

get path.

◆ protocol()

template<typename Protocol >
constexpr protocol_type local::basic_endpoint< Protocol >::protocol ( ) const
inlineconstexprnoexcept

◆ resize()

template<typename Protocol >
void local::basic_endpoint< Protocol >::resize ( size_t  n)
inlinenoexcept

resize data().

Parameters
nsize to resize data() too

if n == 0, path() is considered empty, if n < offsetof(sockaddr_un, sun_path), behaviour is undefined, otherwise path().size() is the rest of the data()

◆ size()

template<typename Protocol >
constexpr size_t local::basic_endpoint< Protocol >::size ( ) const
inlineconstexprnoexcept

bytes used data().

Member Data Documentation

◆ data_

template<typename Protocol >
sockaddr_un local::basic_endpoint< Protocol >::data_
private

◆ path_len_

template<typename Protocol >
size_t local::basic_endpoint< Protocol >::path_len_ {0}
private

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