[Click] Sharing info between elements

Eddie Kohler kohler at cs.ucla.edu
Thu May 5 11:19:24 EDT 2005


Handlers are better if you might want to export the functionality to 
users -- or you might want to call the function indirectly, for 
example, from Counter or DriverManager -- and you're not super 
concerned about speed.

Direct function calls are better if the coupling between elements is 
very tight, and/or you are super concerned about speed.

Eddie


On May 4, 2005, at 7:52 AM, Dagang LI wrote:

> Hi Eddie & Ashwin,
>
> Is using Handlers a better (recommanded) way over this kind of "direct 
> remote function call"? e.g. get the name of the element via a 
> configuration argument and then call its Handlers to access/manipulate 
> its internal variables. I suppose it is cleaner and more consistant, 
> but not sure if I understand the purpose of Handlers correctly.
>
> Kind regards,
> Dagang
> Eddie Kohler wrote:
>
>> Yes.  One can design an "information element" whose sole purpose is 
>> to share information; see, for example, ScheduleInfo or 
>> IPRewriterPatterns.  If element A has a pointer to element B, it can 
>> call methods on element B directly; we frequently do this, and 
>> usually give element B's name to element A via a configuration 
>> argument.  See ICMPRewriter or FTPPortMapper for examples.
>>
>> E
>>
>> On May 2, 2005, at 11:05 PM, Ashwin Chandra wrote:
>>
>>> Is there an easy way of doing this in Click?
>>>
>>> Ash
>>> _______________________________________________
>>> click mailing list
>>> click at amsterdam.lcs.mit.edu
>>> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>>>
>>
>> _______________________________________________
>> click mailing list
>> click at amsterdam.lcs.mit.edu
>> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>>
>



More information about the click mailing list