Click
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ElementFilter Class Reference

Base class for filter predicates for elements and ports. More...

Inheritance diagram for ElementFilter:
CastElementFilter

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.
 

Detailed Description

Base class for filter predicates for elements and ports.

Deprecated:
This class is deprecated. Use RouterVisitor instead.

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.

Constructor & Destructor Documentation

◆ ElementFilter()

ElementFilter::ElementFilter ( )
inline

Construct an ElementFilter.

◆ ~ElementFilter()

virtual ElementFilter::~ElementFilter ( )
inlinevirtual

Destroy an ElementFilter.

Member Function Documentation

◆ check_match()

bool ElementFilter::check_match ( Element *  e,
bool  isoutput,
int  port 
)
virtual

Determine whether an element or port matches this filter.

Parameters
eelement
isoutputtrue for output ports, false for input ports
portport 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.

◆ filter()

void ElementFilter::filter ( Vector< Element * > &  es)

Remove all non-matching elements from es.

Parameters
esarray 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).


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