|
SWC-DB
v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
|
Go to the documentation of this file.
7 #ifndef swcdb_core_comm_Resolver_h
8 #define swcdb_core_comm_Resolver_h
26 endpoint.address().is_v4()
27 ? (out << endpoint.address().to_v4().to_string())
28 : (out <<
'[' << endpoint.address().to_v6().to_string() <<
']')
29 ) <<
':' << endpoint.port();
35 const asio::ip::network_v4
v4;
36 const asio::ip::network_v6
v6;
39 Network(
const asio::ip::network_v4& a_v4) noexcept
43 Network(
const asio::ip::network_v6& a_v6) noexcept
48 :
is_v4(net.is_v4),
v4(net.v4),
v6(net.v6) {
60 namespace Serialization {
64 return 3 + (endpoint.address().is_v4() ? 4 : 16);
77 void decode(
const uint8_t** bufp,
size_t* remainp,
121 const std::string& host,
129 Networks& nets, asio::error_code& ec);
134 asio::error_code& ec);
145 const asio::ip::network_v4& net) noexcept;
148 const asio::ip::network_v6& net) noexcept;
158 #ifdef SWC_IMPL_SOURCE
162 #endif // swcdb_core_comm_Resolver_h
const asio::ip::network_v4 v4
bool is_network(const EndPoint &endpoint, const Networks_v4 &nets_v4, const Networks_v6 &nets_v6) noexcept
void get_networks(const Config::Strings &networks, Networks &nets, asio::error_code &ec)
void get_local_networks(int &err, Networks_v4 &nets_v4, Networks_v6 &nets_v6)
asio::ip::tcp::endpoint EndPoint
Core::Vector< Network > Networks
bool SWC_PURE_FUNC has_endpoint(const EndPoint &e1, const EndPoints &endpoints_in) noexcept
Core::Vector< asio::ip::network_v4 > Networks_v4
size_t endpoints_hash(const EndPoints &endpoints)
SWC_CAN_INLINE uint8_t encoded_length(const Comm::EndPoint &endpoint) noexcept
void print(std::ostream &out, const EndPoints &endpoints)
void encode(uint8_t **bufp, const Comm::EndPoint &endpoint)
Core::Vector< asio::ip::network_v6 > Networks_v6
The SWC-DB C++ namespace 'SWC'.
Property::Value_string::Ptr str(std::string &&v)
void sort(const Networks &nets, const EndPoints &endpoints, EndPoints &sorted)
Core::Vector< EndPoint > EndPoints
SWC_CAN_INLINE Comm::EndPoints decode_endpoints(const uint8_t **bufp, size_t *remainp)
bool is_ipv4_address(const std::string &str) noexcept
SWC_CAN_INLINE Network(const asio::ip::network_v4 &a_v4) noexcept
SWC_CAN_INLINE Network(const asio::ip::network_v6 &a_v6) noexcept
Comm::EndPoint decode(const uint8_t **bufp, size_t *remainp)
const asio::ip::network_v6 v6
SWC_CAN_INLINE Network(const Network &net) noexcept
size_t SWC_PURE_FUNC endpoint_hash(const EndPoint &endpoint) noexcept
bool is_ipv6_address(const std::string &str) noexcept
EndPoints get_endpoints(uint16_t defaul_port, const Config::Strings &addrs, const std::string &host, const Networks &nets, bool srv=false)
SWC_CAN_INLINE std::ostream & operator<<(std::ostream &out, const EndPoint &endpoint)
bool SWC_PURE_FUNC equal_endpoints(const EndPoints &endpoints1, const EndPoints &endpoints2) noexcept