summaryrefslogtreecommitdiff
path: root/inc/TColStd_MapIteratorOfPackedMapOfInteger.hxx
blob: e40837997824ac11b305d63be094e0be38a90e54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// File:      TColStd_MapIteratorOfPackedMapOfInteger.hxx
// Created:   26.11.05 16:47:34
// Author:    Alexander GRIGORIEV
// Copyright: Open Cascade 2005


#ifndef TColStd_MapIteratorOfPackedMapOfInteger_HeaderFile
#define TColStd_MapIteratorOfPackedMapOfInteger_HeaderFile

#include <TCollection_BasicMapIterator.hxx>
#include <Standard_NoSuchObject.hxx>

class TColStd_PackedMapOfInteger;

/**
 * Iterator of class TColStd_PackedMapOfInteger
 */

class TColStd_MapIteratorOfPackedMapOfInteger: public TCollection_BasicMapIterator
{
 public:
  // ---------- PUBLIC METHODS ----------

  /// Empty Constructor.
  inline TColStd_MapIteratorOfPackedMapOfInteger()
    : myIntMask (~0U), myKey (0) {}

  /// Constructor.
  Standard_EXPORT TColStd_MapIteratorOfPackedMapOfInteger
                                (const TColStd_PackedMapOfInteger&);

  /// Re-initialize with the same or another Map instance.
  Standard_EXPORT void        Initialize (const TColStd_PackedMapOfInteger&);

  /// Restart the iteraton
  Standard_EXPORT void        Reset();

  /// Query the iterated key. Defined in TColStd_PackedMapOfInteger.cxx
  inline Standard_Integer     Key () const
  {
    Standard_NoSuchObject_Raise_if ((myIntMask == ~0U),
                               "TColStd_MapIteratorOfPackedMapOfInteger::Key");
    return myKey;
  }

  /// Increment the iterator
  Standard_EXPORT void        Next();

private:
  unsigned int     myIntMask;   ///< all bits set above the iterated position
  Standard_Integer myKey;       ///< Currently iterated key
};


#endif