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

An iterator to traverse IP addresses within a network, excluding specified subnets. More...

#include <ip-network-iterator.hpp>

Inheritance diagram for ip_exclude_network_iterator< T >:

Public Types

using iterator_category = std::forward_iterator_tag
 The category of the iterator.
 
using value_type = T
 The type of value iterated over.
 
using difference_type = int64_t
 Type to represent the difference between two iterators.
 
using pointer = const value_type*
 Pointer to the value type.
 
using reference = const value_type&
 Reference to the value type.
 

Public Member Functions

constexpr inline ip_exclude_network_iterator () noexcept=default
 Default constructor.
 
constexpr inline ip_exclude_network_iterator (reference network, reference other) noexcept
 Constructs an iterator for a network, excluding addresses from another network.
 
constexpr inline reference operator* () const noexcept
 Returns a reference to the current element.
 
constexpr inline pointer operator-> () const noexcept
 Returns a pointer to the current element.
 
constexpr inline ip_exclude_network_iteratoroperator++ ()
 Pre-increment operator.
 
constexpr inline ip_exclude_network_iterator operator++ (int)
 Post-increment operator.
 
constexpr inline bool operator== (const ip_exclude_network_iterator &other) const noexcept
 Equality operator.
 
constexpr inline bool operator!= (const ip_exclude_network_iterator &other) const noexcept
 Inequality operator.
 
constexpr inline bool operator< (const ip_exclude_network_iterator &other) const noexcept
 Less-than operator.
 
constexpr inline bool operator<= (const ip_exclude_network_iterator &other) const noexcept
 Less-than-or-equal-to operator.
 
constexpr inline bool operator> (const ip_exclude_network_iterator &other) const noexcept
 Greater-than operator.
 
constexpr inline bool operator>= (const ip_exclude_network_iterator &other) const noexcept
 Greater-than-or-equal-to operator.
 

Detailed Description

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

An iterator to traverse IP addresses within a network, excluding specified subnets.

This iterator advances through IP addresses within a specified network, skipping over those that belong to a subnet that should be excluded from the traversal. This is particularly useful for operations where certain ranges of IP addresses are reserved or otherwise should not be included.

Template Parameters
TThe type of IPv4 or IPv6 network to iterate over, excluding specified subnets.

Constructor & Destructor Documentation

◆ ip_exclude_network_iterator()

template<typename T >
constexpr inline ip_exclude_network_iterator ( reference network,
reference other )
inlinenoexcept

Constructs an iterator for a network, excluding addresses from another network.

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

Member Function Documentation

◆ operator*()

template<typename T >
constexpr inline reference operator* ( ) const
inlinenoexcept

Returns a reference to the current element.

Returns
A reference to the element pointed to by the iterator.

◆ operator->()

template<typename T >
constexpr inline pointer operator-> ( ) const
inlinenoexcept

Returns a pointer to the current element.

Returns
A pointer to the element pointed to by the iterator.

◆ operator++() [1/2]

template<typename T >
constexpr inline ip_exclude_network_iterator & operator++ ( )
inline

Pre-increment operator.

Returns
A reference to the incremented iterator.

◆ operator++() [2/2]

template<typename T >
constexpr inline ip_exclude_network_iterator operator++ ( int )
inline

Post-increment operator.

Returns
The iterator before incrementing.

◆ operator==()

template<typename T >
constexpr inline bool operator== ( const ip_exclude_network_iterator< T > & other) const
inlinenoexcept

Equality operator.

Compares two ip_exclude_network_iterator for equality.

Parameters
[in]otherThe ip_exclude_network_iterator to compare with.
Returns
true if the iterators are equal, false otherwise.

◆ operator!=()

template<typename T >
constexpr inline bool operator!= ( const ip_exclude_network_iterator< T > & other) const
inlinenoexcept

Inequality operator.

Compares two ip_exclude_network_iterator for inequality.

Parameters
[in]otherThe ip_exclude_network_iterator to compare with.
Returns
true if the iterators are not equal, false otherwise.

◆ operator<()

template<typename T >
constexpr inline bool operator< ( const ip_exclude_network_iterator< T > & other) const
inlinenoexcept

Less-than operator.

Compares two ip_exclude_network_iterator to determine if the left one is less than the right one.

Parameters
[in]otherThe ip_exclude_network_iterator to compare with.
Returns
true if the left iterator is less than the right iterator, false otherwise.

◆ operator<=()

template<typename T >
constexpr inline bool operator<= ( const ip_exclude_network_iterator< T > & other) const
inlinenoexcept

Less-than-or-equal-to operator.

Compares two ip_exclude_network_iterator to determine if the left one is less than or equal to the right one.

Parameters
[in]otherThe ip_exclude_network_iterator to compare with.
Returns
true if the left iterator is less than or equal to the right iterator, false otherwise.

◆ operator>()

template<typename T >
constexpr inline bool operator> ( const ip_exclude_network_iterator< T > & other) const
inlinenoexcept

Greater-than operator.

Compares two ip_exclude_network_iterator to determine if the left one is greater than the right one.

Parameters
[in]otherThe ip_exclude_network_iterator to compare with.
Returns
true if the left iterator is greater than the right iterator, false otherwise.

◆ operator>=()

template<typename T >
constexpr inline bool operator>= ( const ip_exclude_network_iterator< T > & other) const
inlinenoexcept

Greater-than-or-equal-to operator.

Compares two ip_exclude_network_iterator to determine if the left one is greater than or equal to the right one.

Parameters
[in]otherThe ip_exclude_network_iterator to compare with.
Returns
true if the left iterator is greater than or equal to the right iterator, false otherwise.

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