[Click] use of iterator over a hashmap<unsigned, value *> in click

Bart Van Keyenberg bartvk8 at hotmail.com
Thu Mar 24 03:52:39 EST 2005


Hi,

I use in one of my configurations a click hashmap together with an iterator. 
The code compiles but I get a segmentation fault in the code of 
bighashmap.hh itself ( line 468).
Since there are not immediately examples in the provided click elements of 
how to use the hashmap iterator, has somebody already used this function and 
is it possible to give me some piece of demo code ??

Here follows the code that give the segmentation error

Packet * Valve::pull(int){
   Packet *p=0;
    HashMap<unsigned, Usershaper *>::iterator iter = _shapermap.begin();
    while(p==0){
      Usershaper *tempshaper=iter.value();
      if(p=tempshaper->usershaper->pull(0)){
        //return p;
      }
      if(iter==_shapermap.end()){
        iter=_shapermap.begin();
      }
      else{
        iter++;
      }
    }
    return p;

}


<html><P><FONT size=5><EM><A href="mailto:bartvk8 at hotmail.com">Bart 
V.K.</A></EM></FONT></P></html>

_________________________________________________________________




More information about the click mailing list