userver: utils::ip::NetworkBase< Address, typename > Class Template Reference
Loading...
Searching...
No Matches
utils::ip::NetworkBase< Address, typename > Class Template Referencefinal

#include <userver/utils/ip.hpp>

Detailed Description

template<typename Address, typename = std::enable_if_t<kIsAddressType<Address>>>
class utils::ip::NetworkBase< Address, typename >

Base class for IPv4/IPv6 network.

Definition at line 86 of file ip.hpp.

Public Types

using AddressType = Address
 

Public Member Functions

 NetworkBase (const AddressType &address, unsigned short prefix_length)
 
AddressType GetAddress () const noexcept
 Get the address address of network.
 
unsigned char GetPrefixLength () const noexcept
 Get prefix length of address network.
 

Static Public Attributes

static constexpr unsigned char kMaximumPrefixLength
 

Member Typedef Documentation

◆ AddressType

template<typename Address , typename = std::enable_if_t<kIsAddressType<Address>>>
using utils::ip::NetworkBase< Address, typename >::AddressType = Address

Definition at line 88 of file ip.hpp.

Constructor & Destructor Documentation

◆ NetworkBase()

template<typename Address , typename = std::enable_if_t<kIsAddressType<Address>>>
utils::ip::NetworkBase< Address, typename >::NetworkBase ( const AddressType & address,
unsigned short prefix_length )
inline

Definition at line 94 of file ip.hpp.

Member Function Documentation

◆ GetAddress()

template<typename Address , typename = std::enable_if_t<kIsAddressType<Address>>>
AddressType utils::ip::NetworkBase< Address, typename >::GetAddress ( ) const
inlinenoexcept

Get the address address of network.

Definition at line 104 of file ip.hpp.

◆ GetPrefixLength()

template<typename Address , typename = std::enable_if_t<kIsAddressType<Address>>>
unsigned char utils::ip::NetworkBase< Address, typename >::GetPrefixLength ( ) const
inlinenoexcept

Get prefix length of address network.

Definition at line 107 of file ip.hpp.

Friends And Related Symbol Documentation

◆ operator!=

template<typename Address , typename = std::enable_if_t<kIsAddressType<Address>>>
bool operator!= ( const NetworkBase< Address > & a,
const NetworkBase< Address > & b )
friend

Definition at line 114 of file ip.hpp.

◆ operator==

template<typename Address , typename = std::enable_if_t<kIsAddressType<Address>>>
bool operator== ( const NetworkBase< Address > & a,
const NetworkBase< Address > & b )
friend

Definition at line 109 of file ip.hpp.

Member Data Documentation

◆ kMaximumPrefixLength

template<typename Address , typename = std::enable_if_t<kIsAddressType<Address>>>
constexpr unsigned char utils::ip::NetworkBase< Address, typename >::kMaximumPrefixLength
staticconstexpr
Initial value:
=
std::is_same_v<Address, AddressV4> ? 32 : 128

Definition at line 89 of file ip.hpp.


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