mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-06-15 04:04:07 +08:00
0024831: Make iterators of NCollection classes STL-compatible
STL-compatible iterators returned methods begin() and end() are provided in collection classes from NCollection package. NCollection_Array1::Iterator is redesigned to use pointer instead of index. Iterators of Sequence, Array, and Vector are extended by new methods to iterate backwards. Use of SortTools_QuickSortOfReal is replaced by std::sort() in a few places (where possible).
This commit is contained in:
@@ -36,20 +36,24 @@ void NCollection_BaseVector::Iterator::copyV (const NCollection_BaseVector::Iter
|
||||
//purpose : Initialisation of iterator by a vector
|
||||
//=======================================================================
|
||||
|
||||
void NCollection_BaseVector::Iterator::initV (const NCollection_BaseVector& theVector)
|
||||
void NCollection_BaseVector::Iterator::initV (const NCollection_BaseVector& theVector, Standard_Boolean theToEnd)
|
||||
{
|
||||
myVector = &theVector;
|
||||
myICurBlock = 0;
|
||||
myCurIndex = 0;
|
||||
myVector = &theVector;
|
||||
|
||||
if (theVector.myNBlocks == 0)
|
||||
{
|
||||
myIEndBlock = 0;
|
||||
myCurIndex = 0;
|
||||
myEndIndex = 0;
|
||||
myICurBlock = 0;
|
||||
myIEndBlock = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
myIEndBlock = theVector.myNBlocks - 1;
|
||||
myEndIndex = theVector.myData[myIEndBlock].Length;
|
||||
|
||||
myICurBlock = !theToEnd ? 0 : myIEndBlock;
|
||||
myCurIndex = !theToEnd ? 0 : myEndIndex;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user