Logo Search packages:      
Sourcecode: opencascade version File versions  Download package

Standard_Integer TColStd_PackedMapOfInteger::GetMaximalMapped (  )  const

Query the maximal contained key value.

Definition at line 484 of file TColStd_PackedMapOfInteger.cxx.

References IsEmpty(), and NbBuckets().

{
  Standard_Integer aResult (IntegerFirst());
  if (!IsEmpty()) {
    const TCollection_MapNode** aData = (const TCollection_MapNode**) myData1;
    const TColStd_intMapNode * pFoundNode = 0L;
    for (Standard_Integer i = 0; i <= NbBuckets(); i++) {
      for (const TCollection_MapNode * p = aData[i]; p != 0L; p = p->Next()) {
        const Standard_Integer aKey =
          reinterpret_cast <const TColStd_intMapNode *>(p)->Key();
        if (aResult < aKey) {
          aResult = aKey;
          pFoundNode = reinterpret_cast<const TColStd_intMapNode *>(p);
        }
      }
    }
    if (pFoundNode) {
      unsigned int aFullMask (0xffffffff);
      aResult = TColStd_intMapNode_findPrev (pFoundNode, aFullMask);
    }
  }
  return aResult;
}


Generated by  Doxygen 1.6.0   Back to index