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

#include <IPRange.h>

Collaboration diagram for swoc::IPRangeSet:
Collaboration graph

Classes

class  const_iterator
 Bidirectional constant iterator for iteration over ranges. More...
 

Public Types

using iterator = const_iterator
 

Public Member Functions

 IPRangeSet ()=default
 Default construct empty set.
 
self_typemark (swoc::IPRange const &r)
 
self_typefill (swoc::IPRange const &r)
 
bool contains (swoc::IPAddr const &addr) const
 
size_t count () const
 
bool empty () const
 
void clear ()
 Remove all addresses in the set.
 
const_iterator begin () const
 
const_iterator end () const
 

Protected Attributes

Space _addrs
 The address set.
 

Detailed Description

An IPSpace that contains only addresses.

This is to IPSpace as std::set is to std::map. The value_type is removed from the API and only the keys are visible. This suits use cases where the goal is to track the presence of addresses without any additional data.

Note
Because there is only one value stored, there is no difference between mark and fill.

Definition at line 1542 of file IPRange.h.

Member Typedef Documentation

◆ iterator

Definition at line 1656 of file IPRange.h.

Member Function Documentation

◆ begin()

const_iterator swoc::IPRangeSet::begin ( ) const
inline
Returns
Iterator to first range.

Definition at line 1660 of file IPRange.h.

◆ clear()

void swoc::IPRangeSet::clear ( )
inline

Remove all addresses in the set.

Definition at line 1702 of file IPRange.h.

◆ contains()

bool swoc::IPRangeSet::contains ( swoc::IPAddr const & addr) const
inline
Returns
true if addr is in the set.

Definition at line 1687 of file IPRange.h.

◆ count()

size_t swoc::IPRangeSet::count ( ) const
inline
Returns
Number of ranges in the set.

Definition at line 1692 of file IPRange.h.

◆ empty()

bool swoc::IPRangeSet::empty ( ) const
inline

Definition at line 1697 of file IPRange.h.

◆ end()

const_iterator swoc::IPRangeSet::end ( ) const
inline
Returns
Iterator past last range.

Definition at line 1665 of file IPRange.h.

◆ fill()

auto swoc::IPRangeSet::fill ( swoc::IPRange const & r)
inline

Add addresses to the set.

Parameters
rRange of addresses to add.
Returns
this

Identical to mark.

Definition at line 1681 of file IPRange.h.

◆ mark()

auto swoc::IPRangeSet::mark ( swoc::IPRange const & r)
inline

Add addresses to the set.

Parameters
rRange of addresses to add.
Returns
this

Identical to fill.

Definition at line 1675 of file IPRange.h.

Member Data Documentation

◆ _addrs

Space swoc::IPRangeSet::_addrs
protected

The address set.

Definition at line 1671 of file IPRange.h.


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