|
Click
|
Base class for filter predicates for elements and ports. More...
Public Member Functions | |
| ElementFilter () | |
| Construct an ElementFilter. | |
| virtual | ~ElementFilter () |
| Destroy an ElementFilter. | |
| virtual bool | check_match (Element *e, bool isoutput, int port) |
| Determine whether an element or port matches this filter. | |
| void | filter (Vector< Element * > &es) |
| Remove all non-matching elements from es. | |
Base class for filter predicates for elements and ports.
ElementFilter objects are used to search the router configuration graph for matching elements. They are usually passed to the Router::downstream_elements() and Router::upstream_elements() functions.
|
inline |
Construct an ElementFilter.
|
inlinevirtual |
Destroy an ElementFilter.
|
virtual |
Determine whether an element or port matches this filter.
| e | element |
| isoutput | true for output ports, false for input ports |
| port | port number, or -1 to check the element as a whole |
This virtual function is the core of ElementFilter's functionality. The function should return true iff the specified element or port matches the filter. isoutput and port define the interesting port; if port < 0, the element should be checked as a whole.
The default implementation returns false for any element.
Reimplemented in CastElementFilter.
Remove all non-matching elements from es.
| es | array of elements |
Calls check_match(e, false, -1) for each element of es, removing those elements that do not match (i.e., check_match() returns false).