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

#include <IPRange.h>

Collaboration diagram for swoc::IP4Range::NetSource:
Collaboration graph

Public Types

using range_type = IP4Range
 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 (self_type const &that)=default
 Copy constructor.
 
iterator begin () const
 First network.
 
bool empty () const
 Return true if there are valid networks, false if not.
 
IP4Net operator* () const
 
self_typeoperator-> ()
 Access this as if it were an IP4Net.
 
IP4Addr const & 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.
 

Static Public Member Functions

static iterator end ()
 Past last network.
 

Protected Member Functions

void search_wider ()
 
void search_narrower ()
 
bool is_valid (IP4Addr mask) const
 

Protected Attributes

IP4Range _range
 
IP4Addr _mask {~static_cast<in_addr_t>(0)}
 Mask for current network.
 
IPMask::raw_type _cidr = IP4Addr::WIDTH
 Current CIDR value.
 

Detailed Description

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

See also
IP4Range::networks

Definition at line 117 of file IPRange.h.

Member Typedef Documentation

◆ const_iterator

All iteration is constant so no distinction between iterators.

Definition at line 131 of file IPRange.h.

◆ iterator

This class acts as a container and an iterator.

Definition at line 129 of file IPRange.h.

◆ range_type

Import base range type.

Definition at line 120 of file IPRange.h.

Constructor & Destructor Documentation

◆ NetSource()

swoc::IP4Range::NetSource::NetSource ( range_type const & range)
explicit

Construct from range.

Definition at line 991 of file swoc_ip.cc.

Member Function Documentation

◆ addr()

IP4Addr const & swoc::IP4Range::NetSource::addr ( ) const
inline

Iterator support.

Returns
The current network address.

Definition at line 2335 of file IPRange.h.

◆ begin()

IP4Range::NetSource::iterator swoc::IP4Range::NetSource::begin ( ) const
inline

First network.

Definition at line 2310 of file IPRange.h.

◆ empty()

bool swoc::IP4Range::NetSource::empty ( ) const
inline

Return true if there are valid networks, false if not.

Definition at line 2320 of file IPRange.h.

◆ end()

IP4Range::NetSource::iterator swoc::IP4Range::NetSource::end ( )
inlinestatic

Past last network.

Definition at line 2315 of file IPRange.h.

◆ is_valid()

bool swoc::IP4Range::NetSource::is_valid ( swoc::IP4Addr mask) const
inlineprotected

Definition at line 2300 of file IPRange.h.

◆ mask()

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

Iterator support.

Returns
The current network mask.

Definition at line 2325 of file IPRange.h.

◆ operator!=()

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

Inequality.

Definition at line 2345 of file IPRange.h.

◆ operator*()

IP4Net swoc::IP4Range::NetSource::operator* ( ) const
inline
Returns
The current network.

Definition at line 2305 of file IPRange.h.

◆ operator++() [1/2]

auto swoc::IP4Range::NetSource::operator++ ( )

Move to next network.

Definition at line 998 of file swoc_ip.cc.

◆ operator++() [2/2]

auto swoc::IP4Range::NetSource::operator++ ( int )

Move to next network.

Definition at line 1015 of file swoc_ip.cc.

◆ operator->()

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

Access this as if it were an IP4Net.

Definition at line 2330 of file IPRange.h.

◆ operator==()

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

Equality.

Definition at line 2340 of file IPRange.h.

◆ search_narrower()

void swoc::IP4Range::NetSource::search_narrower ( )
protected

Definition at line 1036 of file swoc_ip.cc.

◆ search_wider()

void swoc::IP4Range::NetSource::search_wider ( )
protected

Definition at line 1022 of file swoc_ip.cc.

Member Data Documentation

◆ _cidr

IPMask::raw_type swoc::IP4Range::NetSource::_cidr = IP4Addr::WIDTH
protected

Current CIDR value.

Definition at line 169 of file IPRange.h.

◆ _mask

IP4Addr swoc::IP4Range::NetSource::_mask {~static_cast<in_addr_t>(0)}
protected

Mask for current network.

Definition at line 168 of file IPRange.h.

◆ _range

IP4Range swoc::IP4Range::NetSource::_range
protected

Remaining range.

Definition at line 166 of file IPRange.h.


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