\hypertarget{classEntity_1_1CompareById}{}\section{Entity\+:\+:Compare\+By\+Id Class Reference}
\label{classEntity_1_1CompareById}\index{Entity\+::\+Compare\+By\+Id@{Entity\+::\+Compare\+By\+Id}}


Entity comparison criterion for S\+TL container.  




\subsection{Detailed Description}
Entity comparison criterion for S\+TL container. 

This class is a functor to be used in S\+TL containers of {\ttfamily Entity$\ast$} whenever determinism is required (as an alternative to the object\textquotesingle{}s pointer). If a {\ttfamily N\+U\+LL} pointer is passed as argument, it\textquotesingle{}s {\ttfamily id} is computed as zero, it is a failsafe and should be avoided.


\begin{DoxyCode}
\textcolor{keyword}{typedef}  std::map<Net*,SomeValue,Entity::CompareById>  NetMap;

NetMap  netMap;
forEach( Net*, inet, cell->getNets() ) \{
  netMap.insert( std::make\_pair(*inet,computeSomeValue(*inet)) );
\}

\textcolor{keywordflow}{for} ( NetMap::iterator imap=netMap.begin() ; imap!=netMap.end() ; ++imap ) \{
  \textcolor{comment}{// Show the Net ordering}
  cout << (*imap).first->getId() << \textcolor{stringliteral}{":"} << (*imap).first << endl;
  \textcolor{comment}{// Do something}
  \textcolor{comment}{// ...}
\}
\end{DoxyCode}
 

The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
Entity.\+dox\end{DoxyCompactItemize}
