[Click] Elements handlers

Marko Zec zec at icir.org
Thu Mar 10 16:33:50 EST 2005


On Thursday 10 March 2005 21:22, Rafael Paoliello Guimaraes wrote:
> Hi,
>
> I am writing some new Click elements and I have a doubt concerning
> the handlers of an element. I have seen read handler and write
> handlers implemented, but I have not seen any read/write handler. Is
> there this possibility? I want the handler to return me a string
> based on some arguments I introduce.
>
> I have implemented the following handler:
>
> String
> MyElement::thehandler_handler(const String &conf_in, Element *e, void
> *thunk, ErrorHandler *errh)
>
>
> But I don't know how to add it to the element? Is this right? How
> should I do it?


The Element class provides the add_handlers() virtual function which you 
may override to explicitely export custom handler hooks.  Just grep 
through existing elements for add_handlers...

Marko


More information about the click mailing list