[Click] getting number of element handlers
Eddie Kohler
kohler at cs.ucla.edu
Sun Feb 5 19:31:13 EST 2006
Hi Kristof,
You are looking for Router::element_hindexes().
Vector<int> hindexes;
Router::element_hindexes(element, hindexes);
for (int *hip = hindexes.begin(); hip < hindexes.end(); hip++) {
const Handler *h = Router::handler(element, *hip);
...
}
Or you can parse the output of the element's "handlers" handler.
Note that the element_hindexes() API is not stable; a different way
to do this may be in 1.5.
Eddie
On Feb 5, 2006, at 9:10 AM, Kristof Cauwel wrote:
> Hello,
>
>
>
> In router.hh there is a function handler(Element, int) which
> enables you to get
> an element handler. I want to get all handlers of all elements.
> There is a
> function nelements which gives you the number of elements. I can
> then loop
> through the elements but I don't see a function which gives you the
> number of
> handlers an element got. I guess I could loop untill I get an error
> but that's
> kinda ugly...
>
> Anybody got an idea if there is a function given you the number of
> handlers of a
> given element? If there is a way to loop through ALL handlers, that
> would be ok
> too. I suppose you can ask a handler to which element it belongs.
>
> thanks,
> Kristof
>
>
> --
>
>
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
More information about the click
mailing list