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

Base class for router configuration visitors that collect elements. More...

#include <routervisitor.hh>

Inheritance diagram for ElementTracker:
RouterVisitor ElementCastTracker ElementNeighborhoodTracker

Public Types

typedef Vector< Element * >::const_iterator const_iterator
 Iterator type.
 

Public Member Functions

 ElementTracker (Router *router)
 Construct an ElementTracker.
 
const Vector< Element * > & elements () const
 Return the elements that matched.
 
int size () const
 Return the number of matching elements.
 
Element * operator[] (int i) const
 Return the i'th matching element.
 
const_iterator begin () const
 Return an iterator for the first matching element.
 
const_iterator end () const
 Return an iterator for the end of the container.
 
bool contains (const Element *e) const
 Return true iff element e is a matching element.
 
void insert (Element *e)
 Add element e to the set of matching elements.
 
void clear ()
 Clear the set of matching elements.
 
- Public Member Functions inherited from RouterVisitor
 RouterVisitor ()
 Construct an RouterVisitor.
 
virtual ~RouterVisitor ()
 Destroy an RouterVisitor.
 
virtual bool visit (Element *e, bool isoutput, int port, Element *from_e, int from_port, int distance)
 Visit an element.
 
virtual int distance (Element *e, Element *from_e)
 return the distance between two neighbour elements
 

Detailed Description

Base class for router configuration visitors that collect elements.

ElementTracker is a type of RouterVisitor used to traverse the router configuration graph and collect matching elements. A subclass's visit() function will call insert() to store elements that match. ElementTracker objects are usually passed to the Router::visit_downstream() and Router::visit_upstream() functions.

Member Typedef Documentation

◆ const_iterator

typedef Vector<Element*>::const_iterator ElementTracker::const_iterator

Iterator type.

Constructor & Destructor Documentation

◆ ElementTracker()

ElementTracker::ElementTracker ( Router *  router)

Construct an ElementTracker.

Parameters
routerthe router to be traversed

Member Function Documentation

◆ elements()

const Vector< Element * > & ElementTracker::elements ( ) const
inline

Return the elements that matched.

◆ size()

int ElementTracker::size ( ) const
inline

Return the number of matching elements.

◆ operator[]()

Element * ElementTracker::operator[] ( int  i) const
inline

Return the i'th matching element.

Elements are ordered by their time of first insertion.

◆ begin()

const_iterator ElementTracker::begin ( ) const
inline

Return an iterator for the first matching element.

◆ end()

const_iterator ElementTracker::end ( ) const
inline

Return an iterator for the end of the container.

◆ contains()

bool ElementTracker::contains ( const Element *  e) const
inline

Return true iff element e is a matching element.

◆ insert()

void ElementTracker::insert ( Element *  e)
inline

Add element e to the set of matching elements.

◆ clear()

void ElementTracker::clear ( )
inline

Clear the set of matching elements.


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