|
|
| IPSpace ()=default |
| | Construct an empty space.
|
| |
| self_type & | mark (IPRange const &range, PAYLOAD const &payload) |
| |
| self_type & | mark_bulk (std::pair< DiscreteRange< IP4Addr >, PAYLOAD > *range_payloads, size_t size, bool is_sorted=false) |
| |
| self_type & | mark_bulk (std::vector< std::pair< DiscreteRange< IP4Addr >, PAYLOAD > > &range_payloads, bool is_sorted=false) |
| | vector-based interface for the previous function.
|
| |
| self_type & | mark_bulk (std::pair< DiscreteRange< IP6Addr >, PAYLOAD > *range_payloads, size_t size, bool is_sorted=false) |
| |
| self_type & | mark_bulk (std::vector< std::pair< DiscreteRange< IP6Addr >, PAYLOAD > > &range_payloads, bool is_sorted=false) |
| | vector-based interface for the previous function.
|
| |
| self_type & | fill (IPRange const &range, PAYLOAD const &payload) |
| |
| self_type & | erase (IPRange const &range) |
| |
| template<typename F, typename U = PAYLOAD> |
| self_type & | blend (IPRange const &range, U const &color, F &&blender) |
| |
|
template<typename F, typename U = PAYLOAD> |
| self_type & | blend (IP4Range const &range, U const &color, F &&blender) |
| |
|
template<typename F, typename U = PAYLOAD> |
| self_type & | blend (IP6Range const &range, U const &color, F &&blender) |
| |
| size_t | count () const |
| |
| size_t | count_ip4 () const |
| |
| size_t | count_ip6 () const |
| |
| size_t | count (sa_family_t f) const |
| |
| bool | empty () const |
| |
| void | clear () |
| | Remove all ranges.
|
| |
| iterator | find (IPAddr const &addr) |
| |
| const_iterator | find (IPAddr const &addr) const |
| |
| iterator | find (IP4Addr const &addr) |
| |
| const_iterator | find (IP4Addr const &addr) const |
| |
| iterator | find (IP6Addr const &addr) |
| |
| const_iterator | find (IP6Addr const &addr) const |
| |
| iterator | begin () |
| |
| const_iterator | begin () const |
| |
| iterator | end () |
| |
| const_iterator | end () const |
| |
| iterator | begin_ip4 () |
| |
| const_iterator | begin_ip4 () const |
| |
| iterator | end_ip4 () |
| |
| const_iterator | end_ip4 () const |
| |
| iterator | begin_ip6 () |
| |
| const_iterator | begin_ip6 () const |
| |
| iterator | end_ip6 () |
| |
| const_iterator | end_ip6 () const |
| |
| const_iterator | begin (sa_family_t family) const |
| |
| const_iterator | end (sa_family_t family) const |
| |
| std::pair< iterator, iterator > | intersection (IP4Range const &r) |
| |
| std::pair< iterator, iterator > | intersection (IP6Range const &r) |
| |
| std::pair< iterator, iterator > | intersection (IPRange const &r) |
| |
| template<typename F, typename U> |
| auto | blend (IPRange const &range, U const &color, F &&blender) -> self_type & |
| |
| template<typename F, typename U> |
| auto | blend (IP4Range const &range, U const &color, F &&blender) -> self_type & |
| |
| template<typename F, typename U> |
| auto | blend (IP6Range const &range, U const &color, F &&blender) -> self_type & |
| |
template<typename PAYLOAD>
class swoc::IPSpace< PAYLOAD >
Coloring of IP address space.
- Template Parameters
-
This is a class to do fast coloring and lookup of the IP address space. It is range oriented and performs well for ranges, much less well for singletons. Conceptually every IP address is a key in the space and can have a color / payload of type PAYLOAD.
PAYLOAD must have the properties
- Cheap to copy.
- Comparable via the equality and inequality operators.
Definition at line 1117 of file IPRange.h.
template<typename PAYLOAD>
template<typename F, typename U = PAYLOAD>
Blend color in to the range.
- Template Parameters
-
| F | Blending functor type (deduced). |
| U | Data to blend in to payloads. |
- Parameters
-
| range | Target range. |
| color | Data to blend in to existing payloads in range. |
| blender | Blending functor. |
- Returns
- this
blender is required to have the signature void(PAYLOAD& lhs , U CONST&rhs). It must act as a compound assignment operator, blending rhs into lhs. That is, if the result of blending rhs in to lhs is defined as "lhs @ rhs" for the binary operator "@", then blender computes "lhs @= rhs".
Every address in range is assigned a payload. If the address does not already have a color, it is assigned the default constructed PAYLOAD blended with color. If the address has a PAYLOAD p, p is updated by invoking blender(p, color), with the expectation that p will be updated in place.