[Click] Stupid question, handler example...

Eddie Kohler kohler at cs.ucla.edu
Fri Sep 29 12:28:04 EDT 2006


Sure; take a look at RED.  RED either looks for upstream elements that match a 
spec (i.e., they're Queues), or can take a list.  Here's how it handles the 
list (which is a cpArgument called queues_string).

	Vector<String> eids;
	cp_spacevec(queues_string, eids);
	_queue_elements.clear();
	for (int i = 0; i < eids.size(); i++)
	    if (Element *e = router()->find(eids[i], this, errh))
		_queue_elements.push_back(e);
	if (eids.size() != _queue_elements.size())
	    return -1;

Eddie


Nicholas Weaver wrote:
> 	Stupid question: is there a good example someplace on how to
> get handlers for an element?  EG, having one or more LinearIPLookup
> elements that you want to access from another element?
> 
> 	Thanks.
> 


More information about the click mailing list