function object to compare to ExpandedNodes More...
#include <DDExpandedNode.h>
Public Member Functions | |
bool | operator() (const DDExpandedNode &n1, const DDExpandedNode &n2) |
function object to compare to ExpandedNodes
compares (for STL usage) two DDExpandedNodes for
Definition at line 64 of file DDExpandedNode.h.
bool DDExpandedNodeLess::operator() | ( | const DDExpandedNode & | n1, |
const DDExpandedNode & | n2 | ||
) | [inline] |
Definition at line 67 of file DDExpandedNode.h.
References DDExpandedNode::absTranslation(), DDBase< N, C >::ddname(), DDExpandedNode::logicalPart(), query::result, and DDExpandedNode::siblingno().
{ const DDTranslation & t1 = n1.absTranslation(); const DDTranslation & t2 = n2.absTranslation(); bool result = false; // 'alphabetical ordering' according to absolute position if (t1.z() < t2.z()) { result=true; } else if ( (t1.z()==t2.z()) && (t1.y() < t2.y())) { result=true; } else if ( (t1.z()==t2.z()) && (t1.y()==t2.y()) && (t1.x()<t2.x())) { result=true; } else if (n1.siblingno() < n2.siblingno()) { result=true; } else if (n1.logicalPart().ddname() < n2.logicalPart().ddname()) { result=true; } return result; }