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

A sequence container for networks excluding specified subnets. More...

#include <ip-network-iterator.hpp>

Public Types

using value_type = T
 The type of network 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 network type.
 
using const_pointer = const value_type*
 Const pointer to the network type.
 
using reference = value_type&
 Reference to the network type.
 
using const_reference = const value_type&
 Const reference to the network type.
 
using iterator = ip_exclude_network_iterator<value_type>
 Iterator for excluded network traversal.
 
using const_iterator = ip_exclude_network_iterator<value_type>
 Const iterator for excluded network traversal.
 

Public Member Functions

constexpr inline exclude_network_sequence () noexcept=default
 Default constructor.
 
constexpr inline exclude_network_sequence (const_reference network, const_reference other) noexcept
 Constructs a sequence for a network, excluding addresses from another network.
 
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_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 bool empty () const noexcept
 Checks if the sequence is empty.
 

Detailed Description

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

A sequence container for networks excluding specified subnets.

This class template represents a sequence of network ranges while excluding certain subnets. It provides iterators to traverse the network ranges that are not part of the excluded subnets, allowing for operations that require consideration of only certain parts of a network.

Template Parameters
TThe type of IP network from which subnets are to be excluded.
Remarks
When iterating, obtaining networks occurs through lazy calculations.

Constructor & Destructor Documentation

◆ exclude_network_sequence()

template<typename T >
constexpr inline exclude_network_sequence ( const_reference network,
const_reference other )
inlinenoexcept

Constructs a sequence for a network, excluding addresses from another network.

Initializes the sequence to represent the 'network' parameter while excluding addresses that fall within the 'other' network. This setup is useful for iterating over a larger network while skipping over a smaller, reserved subnet.

Parameters
[in]networkThe network to iterate over.
[in]otherThe network whose addresses are to be excluded.

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.

◆ 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.

◆ 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.

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