CppGraph Application Framework©
Copyright © 2004-202x Geoff Goldberg
Filtering

Overview

Some operations allow a filter to be specified. A filter distinguishes objects that are to be operated on from those that are not.

Filters implement a boolean function that takes an object as a parameter and returns true if that object passes the filter. There are several filter class hierarchies, corresponding to the type of object they filter. There are a large number of predefined filters. The user is free to implement others.

Filter Users

Operations that use filters include:

Filter Usage

To determine if a specific filter instance passes a specific item instance, use passes_filter().

Filter Types

Types of filter hierarchies include the following:

A function that takes a filter argument specifies one of these types as its filter parameter.

Each filter hierarchy includes, at a minimum, implementations of the following filter types:

Filter Shortcuts

Shortcut free functions are provided to construct filters that implement some of the more complex, but commonly-used patterns,

Filters are Nodes

Filter classes are derived from node. Therefore, node capabilities apply to instances of them.

Motivation

The filtering feature is motivated by:

Note
Any operation that has a filter parameter, defaults it to nullptr. A filter with this value is treated as an any_<xxx>_filter, passing all objects.