Header file getaddrinfo_code.hpp

#include "quick_status_code_from_enum.hpp"

namespace system_error2
{
    using getaddrinfo_code = status_code<system_error2::_getaddrinfo_code_domain>;

    using getaddrinfo_error = status_error<system_error2::_getaddrinfo_code_domain>;

    class _getaddrinfo_code_domain;

    constexpr system_error2::_getaddrinfo_code_domain const getaddrinfo_code_domain;

    static constexpr system_error2::_getaddrinfo_code_domain const& _getaddrinfo_code_domain::get();
}

Type alias system_error2::getaddrinfo_code

using getaddrinfo_code = status_code<system_error2::_getaddrinfo_code_domain>;

A getaddrinfo error code, those returned by getaddrinfo().


Type alias system_error2::getaddrinfo_error

using getaddrinfo_error = status_error<system_error2::_getaddrinfo_code_domain>;

A specialisation of status_error for the getaddrinfo() error code domain.


Class system_error2::_getaddrinfo_code_domain

class _getaddrinfo_code_domain
: public status_code_domain
{
public:
    using value_type = int;

    constexpr _getaddrinfo_code_domain(typename _base::unique_id_type id = 0x5b24b2de470ff7b6) noexcept;

    _getaddrinfo_code_domain(system_error2::_getaddrinfo_code_domain const&) = default;

    _getaddrinfo_code_domain(system_error2::_getaddrinfo_code_domain&&) = default;

    system_error2::_getaddrinfo_code_domain& operator=(system_error2::_getaddrinfo_code_domain const&) = default;

    system_error2::_getaddrinfo_code_domain& operator=(system_error2::_getaddrinfo_code_domain&&) = default;

    ~_getaddrinfo_code_domain() = default;

    static constexpr system_error2::_getaddrinfo_code_domain const& get();

    virtual system_error2::status_code_domain::string_ref name() const noexcept;

protected:
    virtual bool _do_failure(status_code<void> const& code) const noexcept;

    virtual bool _do_equivalent(status_code<void> const& code1, status_code<void> const& code2) const noexcept;

    virtual system_error2::generic_code _generic_code(status_code<void> const& code) const noexcept;

    virtual system_error2::status_code_domain::string_ref _do_message(status_code<void> const& code) const noexcept;

    virtual void _do_throw_exception(status_code<void> const& code) const;
};

The implementation of the domain for getaddrinfo() error codes, those returned by getaddrinfo().

Type alias system_error2::_getaddrinfo_code_domain::value_type

using value_type = int;

The value type of the getaddrinfo() code, which is an int


Constructor system_error2::_getaddrinfo_code_domain::_getaddrinfo_code_domain

constexpr _getaddrinfo_code_domain(typename _base::unique_id_type id = 0x5b24b2de470ff7b6) noexcept;

Default constructor


Function system_error2::_getaddrinfo_code_domain::get

static constexpr system_error2::_getaddrinfo_code_domain const& get();

Constexpr singleton getter. Returns constexpr getaddrinfo_code_domain variable.



Variable system_error2::getaddrinfo_code_domain

constexpr system_error2::_getaddrinfo_code_domain const getaddrinfo_code_domain;

A constexpr source variable for the getaddrinfo() code domain, which is that of getaddrinfo(). Returned by _getaddrinfo_code_domain::get().