userver: utils::ip::AddressBase< N > Class Template Reference
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
utils::ip::AddressBase< N > Class Template Referencefinal

Your opinion will help to improve our service

Leave a feedback >

#include <userver/utils/ip.hpp>

Detailed Description

template<std::size_t N>
class utils::ip::AddressBase< N >

Base class for IPv4/IPv6 addresses.

Definition at line 28 of file ip.hpp.

Public Types

using BytesType = std::array< unsigned char, N >
 

Public Member Functions

 AddressBase (const BytesType &address)
 
const BytesType & GetBytes () const noexcept
 Get the address in bytes, in network byte order.
 

Static Public Attributes

static constexpr std::size_t AddressSize = N
 

Member Typedef Documentation

◆ BytesType

template<std::size_t N>
using utils::ip::AddressBase< N >::BytesType = std::array<unsigned char, N>

Definition at line 33 of file ip.hpp.

Constructor & Destructor Documentation

◆ AddressBase() [1/2]

template<std::size_t N>
utils::ip::AddressBase< N >::AddressBase ( )
inlinenoexcept

Definition at line 35 of file ip.hpp.

◆ AddressBase() [2/2]

template<std::size_t N>
utils::ip::AddressBase< N >::AddressBase ( const BytesType &  address)
inlineexplicit

Definition at line 36 of file ip.hpp.

Member Function Documentation

◆ GetBytes()

template<std::size_t N>
const BytesType & utils::ip::AddressBase< N >::GetBytes ( ) const
inlinenoexcept

Get the address in bytes, in network byte order.

Definition at line 39 of file ip.hpp.

Friends And Related Symbol Documentation

◆ operator!=

template<std::size_t N>
bool operator!= ( const AddressBase< N > &  a1,
const AddressBase< N > &  a2 
)
friend

Definition at line 45 of file ip.hpp.

◆ operator==

template<std::size_t N>
bool operator== ( const AddressBase< N > &  a1,
const AddressBase< N > &  a2 
)
friend

Definition at line 41 of file ip.hpp.

Member Data Documentation

◆ AddressSize

template<std::size_t N>
constexpr std::size_t utils::ip::AddressBase< N >::AddressSize = N
staticconstexpr

Definition at line 32 of file ip.hpp.


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