ipaddress 1.1.0
|
A sequence container for subnet ranges within a network. More...
#include <ip-network-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 = typename value_type::uint_type |
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_network_iterator<value_type> |
Forward iterator for subnet traversal. | |
using | const_iterator = ip_network_iterator<value_type> |
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. | |
using | ip_address_type = typename value_type::ip_address_type |
The underlying IP address type. | |
Public Member Functions | |
constexpr inline | subnets_sequence () noexcept=default |
Default constructor. | |
constexpr inline | subnets_sequence (const ip_address_type &network_address, size_t new_prefixlen) noexcept |
Constructs a sequence of subnets from a single network address with a new prefix length. | |
constexpr inline | subnets_sequence (const ip_address_type &network_address, const ip_address_type &broadcast_address, const ip_address_type &hostmask, size_t prefixlen_diff, size_t new_prefixlen) noexcept |
Constructs a sequence of subnets from a network address range with a new prefix length. | |
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. | |
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.
T | The type of IP network to be divided into subnets. |
|
inlinenoexcept |
Constructs a sequence of subnets from a single network address with a new prefix length.
Initializes the sequence to represent subnets derived from the provided network address, each with the specified new prefix length. This constructor is typically used when the entire network is to be subdivided into subnets of equal size.
[in] | network_address | The base network address for the sequence. |
[in] | new_prefixlen | The new prefix length for the subnets. |
|
inlinenoexcept |
Constructs a sequence of subnets from a network address range with a new prefix length.
Initializes the sequence to represent subnets derived from the provided network address range, each with the specified new prefix length.
[in] | network_address | The starting network address for the sequence. |
[in] | broadcast_address | The broadcast address of the network. |
[in] | hostmask | The hostmask of the network. |
[in] | prefixlen_diff | The difference in prefix length from the original network to the subnets. |
[in] | new_prefixlen | The new prefix length for the subnets. |
|
inlinenodiscardnoexcept |
Gets the beginning iterator of the sequence.
|
inlinenodiscardnoexcept |
Gets the end iterator of the sequence.
|
inlinenodiscardnoexcept |
Gets the beginning reverse iterator of the sequence.
|
inlinenodiscardnoexcept |
Gets the end reverse iterator of the sequence.
|
inlinenodiscardnoexcept |
Gets the beginning const iterator of the sequence.
|
inlinenodiscardnoexcept |
Gets the end const iterator of the sequence.
|
inlinenodiscardnoexcept |
Gets the beginning const reverse iterator of the sequence.
|
inlinenodiscardnoexcept |
Gets the end const reverse iterator of the sequence.
|
inlinenodiscardnoexcept |
Checks if the sequence is empty.
true
if the sequence is empty, false
otherwise.
|
inlinenodiscardnoexcept |
Gets the size of the sequence.
|
inlinenodiscardnoexcept |
Accesses an element by index.
[in] | n | The index of the element. |
|
inlinenodiscardnoexcept |
Accesses an element by index with bounds checking.
[in] | n | The index of the element. |
|
inlinenodiscardnoexcept |
Accesses the first element in the sequence.
|
inlinenodiscardnoexcept |
Accesses the last element in the sequence.