LibSWOC++ 1.5.14
Solid Wall of C++
Loading...
Searching...
No Matches
swoc::IPRange::NetSource Class Reference

#include <IPRange.h>

Collaboration diagram for swoc::IPRange::NetSource:
Collaboration graph

Public Types

using range_type = IPRange
 Import base range type.
 
using iterator = self_type
 This class acts as a container and an iterator.
 
using const_iterator = iterator
 All iteration is constant so no distinction between iterators.
 

Public Member Functions

 NetSource (range_type const &range)
 Construct from range.
 
 NetSource (IPRangeView const &rv)
 Construct from view.
 
 NetSource (self_type const &that)=default
 Copy constructor.
 
iterator begin () const
 First network.
 
iterator end () const
 Past last network.
 
IPNet operator* () const
 
self_typeoperator-> ()
 Access this as if it were an IP6Net.
 
IPAddr addr () const
 
IPMask mask () const
 
self_typeoperator++ ()
 Move to next network.
 
self_type operator++ (int)
 Move to next network.
 
bool operator== (self_type const &that) const
 Equality.
 
bool operator!= (self_type const &that) const
 Inequality.
 

Protected Attributes

union { 
 
   std::monostate   _nil 
 Default value, no addresses. More...
 
   IP4Range::NetSource   _ip4 
 IPv4 addresses. More...
 
   IP6Range::NetSource   _ip6 
 IPv6 addresses. More...
 
};  
 
sa_family_t _family = AF_UNSPEC
 Mark for union content.
 

Detailed Description

Network generator class. This generates networks from a range and acts as both a forward iterator and a container.

See also
IPRange::networks

Definition at line 531 of file IPRange.h.

Member Typedef Documentation

◆ const_iterator

All iteration is constant so no distinction between iterators.

Definition at line 548 of file IPRange.h.

◆ iterator

This class acts as a container and an iterator.

Definition at line 546 of file IPRange.h.

◆ range_type

Import base range type.

Definition at line 534 of file IPRange.h.

Constructor & Destructor Documentation

◆ NetSource() [1/2]

swoc::IPRange::NetSource::NetSource ( range_type const & range)
inlineexplicit

Construct from range.

Definition at line 2399 of file IPRange.h.

◆ NetSource() [2/2]

swoc::IPRange::NetSource::NetSource ( IPRangeView const & rv)
inlineexplicit

Construct from view.

Definition at line 2409 of file IPRange.h.

Member Function Documentation

◆ addr()

IPAddr swoc::IPRange::NetSource::addr ( ) const
inline

Iterator support.

Returns
The current network address.

Definition at line 2430 of file IPRange.h.

◆ begin()

auto swoc::IPRange::NetSource::begin ( ) const
inline

First network.

Definition at line 2420 of file IPRange.h.

◆ end()

auto swoc::IPRange::NetSource::end ( ) const
inline

Past last network.

Definition at line 2425 of file IPRange.h.

◆ mask()

IPMask swoc::IPRange::NetSource::mask ( ) const
inline

Iterator support.

Returns
The current network mask.

Definition at line 2440 of file IPRange.h.

◆ operator!=()

bool swoc::IPRange::NetSource::operator!= ( self_type const & that) const
inline

Inequality.

Definition at line 2485 of file IPRange.h.

◆ operator*()

IPNet swoc::IPRange::NetSource::operator* ( ) const
inline
Returns
The current network.

Definition at line 2450 of file IPRange.h.

◆ operator++()

auto swoc::IPRange::NetSource::operator++ ( )
inline

Move to next network.

Definition at line 2455 of file IPRange.h.

◆ operator->()

auto swoc::IPRange::NetSource::operator-> ( )
inline

Access this as if it were an IP6Net.

Definition at line 2465 of file IPRange.h.

◆ operator==()

bool swoc::IPRange::NetSource::operator== ( self_type const & that) const
inline

Equality.

Definition at line 2470 of file IPRange.h.

Member Data Documentation

◆ _family

sa_family_t swoc::IPRange::NetSource::_family = AF_UNSPEC
protected

Mark for union content.

Definition at line 586 of file IPRange.h.

◆ _ip4

IP4Range::NetSource swoc::IPRange::NetSource::_ip4

IPv4 addresses.

Definition at line 582 of file IPRange.h.

◆ _ip6

IP6Range::NetSource swoc::IPRange::NetSource::_ip6

IPv6 addresses.

Definition at line 583 of file IPRange.h.

◆ _nil

std::monostate swoc::IPRange::NetSource::_nil

Default value, no addresses.

Definition at line 581 of file IPRange.h.


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