1 // Created on: 1993-02-26
2 // Created by: Remi LEQUETTE
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
18 #include <TCollection_BasicMap.hxx>
19 #include <TCollection_BasicMapIterator.hxx>
20 #include <TCollection_MapNode.hxx>
22 //=======================================================================
23 //function : TCollection_BasicMapIterator
25 //=======================================================================
26 TCollection_BasicMapIterator::TCollection_BasicMapIterator () :
34 //=======================================================================
35 //function : TCollection_BasicMapIterator
37 //=======================================================================
39 TCollection_BasicMapIterator::TCollection_BasicMapIterator
40 (const TCollection_BasicMap& M) :
42 myNbBuckets(M.myNbBuckets),
46 if (!myBuckets) myNbBuckets = -1;
50 //=======================================================================
51 //function : Initialize
53 //=======================================================================
55 void TCollection_BasicMapIterator::Initialize
56 (const TCollection_BasicMap& M)
58 myNbBuckets = M.myNbBuckets;
59 myBuckets = M.myData1;
62 if (!myBuckets) myNbBuckets = -1;
66 //=======================================================================
69 //=======================================================================
71 void TCollection_BasicMapIterator::Reset()
78 //=======================================================================
81 //=======================================================================
83 void TCollection_BasicMapIterator::Next()
85 if (!myBuckets) return;
88 myNode = ((TCollection_MapNode*) myNode)->Next();
94 if (myBucket > myNbBuckets) return;
95 myNode = ((TCollection_MapNodePtr*)myBuckets)[myBucket];