now it works thanks
On 9/23/13 10:10 PM, Sascha Alexander Jopen wrote: > Hi Hamid, > > you can either use Router::elements() to iterate over all elements in > your configuration if there are several potential candiates, or use > Router::find("elemB") if you give the element to be found a name like so: > > elemA :: elementA(); > elemB :: elementB(); > > Regards, > Sascha > > On 23.09.2013 14:46, Hamid Farhadi wrote: >> Hi >> >> using Router::visit_upstream/downstream() in this config elementA can >> find elementB: >> elementA()->elementB(); >> >> But in this one it can not: >> elementA(); >> elementB(); >> >> I mean consider some elements like ControlSocket, how can I find it from >> another element, please? >> >> Here is how I use Router::visit_upstream/downstream(): >> >> ElementCastTracker filter(router() , "elementB" ); >> Element* e = router()->visit_upstream( this , 0 , &filter ); >> elementB* b = (elementB*)filter[0]->cast( "elementB" ); >> >> If the solution is Router::find(), I could not find an example of how to >> use it. when it returns an element, how should I cast it to use its members? >> >> Any help is appreciated, >> Hamid >> >> >> _______________________________________________ >> click mailing list >> click@amsterdam.lcs.mit.edu >> https://amsterdam.lcs.mit.edu/mailman/listinfo/click >> > > _______________________________________________ click mailing list click@amsterdam.lcs.mit.edu https://amsterdam.lcs.mit.edu/mailman/listinfo/click