# Hurricane Documentation

# Hurricane VLSI Database

Entity::CompareById Class Reference

Entity comparison criterion for STL container. More...

## Detailed Description

Entity comparison criterion for STL container.

This class is a functor to be used in STL containers of `Entity*` whenever determinism is required (as an alternative to the object's pointer). If a `NULL` pointer is passed as argument, it's `id` is computed as zero, it is a failsafe and should be avoided.

typedef std::map<Net*,SomeValue,Entity::CompareById> NetMap;
NetMap netMap;
forEach( Net*, inet, cell->getNets() ) {
netMap.insert( std::make_pair(*inet,computeSomeValue(*inet)) );
}
for ( NetMap::iterator imap=netMap.begin() ; imap!=netMap.end() ; ++imap ) {
// Show the Net ordering
cout << (*imap).first->getId() << ":" << (*imap).first << endl;
// Do something
// ...
}

The documentation for this class was generated from the following file:

- Entity.dox