ipaddress 1.1.0
Loading...
Searching...
No Matches
subnets_any_sequence< T > Class Template Reference

A sequence container for subnet ranges within a network. More...

#include <ip-any-iterator.hpp>

Public Types

using value_type = T
 The type of subnet value.
 
using size_type = size_t
 An unsigned integral type.
 
using difference_type = uint128_t
 Unsigned integer type for differences.
 
using pointer = value_type*
 Pointer to the subnet type.
 
using const_pointer = const value_type*
 Const pointer to the subnet type.
 
using reference = value_type&
 Reference to the subnet type.
 
using const_reference = const value_type&
 Const reference to the subnet type.
 
using iterator = ip_any_iterator<value_type, ip_network_iterator<ipv4_network>, ip_network_iterator<ipv6_network>>
 Forward iterator for subnet traversal.
 
using const_iterator = iterator
 Const forward iterator for subnet traversal.
 
using reverse_iterator = ip_reverse_iterator<iterator>
 Reverse iterator for subnet traversal.
 
using const_reverse_iterator = ip_reverse_iterator<const_iterator>
 Const reverse iterator for subnet.
 

Public Member Functions

constexpr inline subnets_any_sequence (ip_network_iterator< ipv4_network > begin, ip_network_iterator< ipv4_network > end) noexcept
 Constructs a subnets_any_sequence with specified network parameters.
 
constexpr inline subnets_any_sequence (ip_network_iterator< ipv6_network > begin, ip_network_iterator< ipv6_network > end) noexcept
 Constructs a subnets_any_sequence with specified network parameters.
 
constexpr inline const_iterator begin () const noexcept
 Gets the beginning iterator of the sequence.
 
constexpr inline const_iterator end () const noexcept
 Gets the end iterator of the sequence.
 
constexpr inline const_reverse_iterator rbegin () const noexcept
 Gets the beginning reverse iterator of the sequence.
 
constexpr inline const_reverse_iterator rend () const noexcept
 Gets the end reverse iterator of the sequence.
 
constexpr inline const_iterator cbegin () const noexcept
 Gets the beginning const iterator of the sequence.
 
constexpr inline const_iterator cend () const noexcept
 Gets the end const iterator of the sequence.
 
constexpr inline const_reverse_iterator crbegin () const noexcept
 Gets the beginning const reverse iterator of the sequence.
 
constexpr inline const_reverse_iterator crend () const noexcept
 Gets the end const reverse iterator of the sequence.
 
constexpr inline bool empty () const noexcept
 Checks if the sequence is empty.
 
constexpr inline difference_type size () const noexcept
 Gets the size of the sequence.
 
constexpr inline value_type operator[] (difference_type n) const noexcept
 Accesses an element by index.
 
constexpr inline value_type at (difference_type n) const noexcept
 Accesses an element by index with bounds checking.
 
constexpr inline value_type front () const noexcept
 Accesses the first element in the sequence.
 
constexpr inline value_type back () const noexcept
 Accesses the last element in the sequence.
 

Detailed Description

template<typename T>
class ipaddress::subnets_any_sequence< T >

A sequence container for subnet ranges within a network.

This class template represents a sequence of subnets within a network. It provides forward and reverse iterators to traverse the subnets and offers insight into the structure of a network by breaking it down into smaller, manageable parts.

Template Parameters
TThe type of IP network to be divided into subnets.
Remarks
When iterating, obtaining networks occurs through lazy calculations.

Constructor & Destructor Documentation

◆ subnets_any_sequence() [1/2]

template<typename T >
constexpr inline subnets_any_sequence ( ip_network_iterator< ipv4_network > begin,
ip_network_iterator< ipv4_network > end )
inlinenoexcept

Constructs a subnets_any_sequence with specified network parameters.

Parameters
[in]beginThe begin ipv4 network iterator.
[in]endThe end ipv4 network iterator.

◆ subnets_any_sequence() [2/2]

template<typename T >
constexpr inline subnets_any_sequence ( ip_network_iterator< ipv6_network > begin,
ip_network_iterator< ipv6_network > end )
inlinenoexcept

Constructs a subnets_any_sequence with specified network parameters.

Parameters
[in]beginThe begin ipv6 network iterator.
[in]endThe end ipv6 network iterator.

Member Function Documentation

◆ begin()

template<typename T >
constexpr inline const_iterator begin ( ) const
inlinenoexcept

Gets the beginning iterator of the sequence.

Returns
A const_iterator to the first element in the sequence.

◆ end()

template<typename T >
constexpr inline const_iterator end ( ) const
inlinenoexcept

Gets the end iterator of the sequence.

Returns
A const_iterator to the element following the last element in the sequence.

◆ rbegin()

template<typename T >
constexpr inline const_reverse_iterator rbegin ( ) const
inlinenoexcept

Gets the beginning reverse iterator of the sequence.

Returns
A const_reverse_iterator to the first element of the reversed sequence.

◆ rend()

template<typename T >
constexpr inline const_reverse_iterator rend ( ) const
inlinenoexcept

Gets the end reverse iterator of the sequence.

Returns
A const_reverse_iterator to the element following the last element of the reversed sequence.

◆ cbegin()

template<typename T >
constexpr inline const_iterator cbegin ( ) const
inlinenoexcept

Gets the beginning const iterator of the sequence.

Returns
A const_iterator to the first element in the sequence.

◆ cend()

template<typename T >
constexpr inline const_iterator cend ( ) const
inlinenoexcept

Gets the end const iterator of the sequence.

Returns
A const_iterator to the element following the last element in the sequence.

◆ crbegin()

template<typename T >
constexpr inline const_reverse_iterator crbegin ( ) const
inlinenoexcept

Gets the beginning const reverse iterator of the sequence.

Returns
A const_reverse_iterator to the first element of the reversed sequence.

◆ crend()

template<typename T >
constexpr inline const_reverse_iterator crend ( ) const
inlinenoexcept

Gets the end const reverse iterator of the sequence.

Returns
A const_reverse_iterator to the element following the last element of the reversed sequence.

◆ empty()

template<typename T >
constexpr inline bool empty ( ) const
inlinenoexcept

Checks if the sequence is empty.

Returns
true if the sequence is empty, false otherwise.

◆ size()

template<typename T >
constexpr inline difference_type size ( ) const
inlinenoexcept

Gets the size of the sequence.

Returns
The number of elements in the sequence.

◆ operator[]()

template<typename T >
constexpr inline value_type operator[] ( difference_type n) const
inlinenoexcept

Accesses an element by index.

Parameters
[in]nThe index of the element.
Returns
The element at the specified index.

◆ at()

template<typename T >
constexpr inline value_type at ( difference_type n) const
inlinenoexcept

Accesses an element by index with bounds checking.

Parameters
[in]nThe index of the element.
Returns
The element at the specified index.

◆ front()

template<typename T >
constexpr inline value_type front ( ) const
inlinenoexcept

Accesses the first element in the sequence.

Returns
A reference to the first element in the sequence.

◆ back()

template<typename T >
constexpr inline value_type back ( ) const
inlinenoexcept

Accesses the last element in the sequence.

Returns
A reference to the last element in the sequence.

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