2#ifndef CLICK_ROUTERVISITOR_HH
3#define CLICK_ROUTERVISITOR_HH
6#include <click/pair.hh>
94 return _elements.
size();
107 return _elements.
begin();
111 return _elements.
end();
116 return _reached[e->
eindex()];
121 if (!_reached[e->
eindex()]) {
122 _reached[e->
eindex()] =
true;
Vector of bits.
Definition bitvector.hh:21
void clear()
Set all bits to false.
Definition bitvector.cc:59
Router configuration visitor that collects elements that match a certain cast.
Definition routervisitor.hh:157
ElementCastTracker(Router *router, const String &name, bool stopAtFirst=true)
Construct an ElementCastTracker.
Definition routervisitor.hh:162
bool visit(Element *e, bool isoutput, int port, Element *from_e, int from_port, int distance)
Visit an element.
Definition routervisitor.cc:45
Base class for Click elements.
Definition element.hh:42
int eindex() const
Return the element's index within its router.
Definition element.hh:524
Router configuration visitor that collects close-by elements.
Definition routervisitor.hh:192
bool visit(Element *e, bool isoutput, int port, Element *from_e, int from_port, int distance)
Visit an element.
Definition routervisitor.cc:55
ElementNeighborhoodTracker(Router *router, int diameter=1)
Construct an ElementNeighborhoodTracker.
Definition routervisitor.hh:198
Base class for router configuration visitors that collect elements.
Definition routervisitor.hh:82
Vector< Element * >::const_iterator const_iterator
Iterator type.
Definition routervisitor.hh:104
void insert(Element *e)
Add element e to the set of matching elements.
Definition routervisitor.hh:120
void clear()
Clear the set of matching elements.
Definition routervisitor.hh:128
const Vector< Element * > & elements() const
Return the elements that matched.
Definition routervisitor.hh:89
const_iterator begin() const
Return an iterator for the first matching element.
Definition routervisitor.hh:106
bool contains(const Element *e) const
Return true iff element e is a matching element.
Definition routervisitor.hh:115
const_iterator end() const
Return an iterator for the end of the container.
Definition routervisitor.hh:110
Element * operator[](int i) const
Return the i'th matching element.
Definition routervisitor.hh:99
int size() const
Return the number of matching elements.
Definition routervisitor.hh:93
A router configuration.
Definition router.hh:28
Base class for router configuration visitors.
Definition routervisitor.hh:17
virtual int distance(Element *e, Element *from_e)
return the distance between two neighbour elements
Definition routervisitor.cc:35
virtual ~RouterVisitor()
Destroy an RouterVisitor.
Definition routervisitor.hh:24
RouterVisitor()
Construct an RouterVisitor.
Definition routervisitor.hh:20
virtual bool visit(Element *e, bool isoutput, int port, Element *from_e, int from_port, int distance)
Visit an element.
Definition routervisitor.cc:29
A string of characters.
Definition string.hh:22
Vector template.
Definition vector.hh:111
void clear()
Remove all elements.
Definition vector.hh:476
iterator end()
Return an iterator for the end of the vector.
Definition vector.hh:266
iterator begin()
Return an iterator for the first element in the vector.
Definition vector.hh:253
size_type size() const
Return the number of elements.
Definition vector.hh:231
void push_back(value_argument_type v)
Append element v.
Definition vector.hh:399