File indexing completed on 2026-09-28 09:19:34
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _BRepGraph_CacheIterator_HeaderFile
0015 #define _BRepGraph_CacheIterator_HeaderFile
0016
0017 #include <BRepGraph_CacheRegistry.hxx>
0018 #include <NCollection_ForwardRange.hxx>
0019
0020
0021
0022
0023 class BRepGraph_CacheIterator
0024 {
0025 public:
0026
0027 explicit BRepGraph_CacheIterator(const BRepGraph_CacheRegistry& theRegistry)
0028 : myRegistry(&theRegistry),
0029 myCount(theRegistry.NbCaches())
0030 {
0031 }
0032
0033
0034 [[nodiscard]] bool More() const { return myCurrent < myCount; }
0035
0036
0037 void Next() { ++myCurrent; }
0038
0039
0040 [[nodiscard]] occ::handle<BRepGraph_Cache> Value() const { return myRegistry->Cache(myCurrent); }
0041
0042
0043 [[nodiscard]] uint32_t Slot() const { return myCurrent; }
0044
0045
0046 [[nodiscard]] uint32_t NbCaches() const { return myRegistry->NbCaches(); }
0047
0048
0049 NCollection_ForwardRangeIterator<BRepGraph_CacheIterator> begin()
0050 {
0051 return NCollection_ForwardRangeIterator<BRepGraph_CacheIterator>(this);
0052 }
0053
0054
0055 NCollection_ForwardRangeSentinel end() const { return NCollection_ForwardRangeSentinel{}; }
0056
0057 private:
0058 const BRepGraph_CacheRegistry* myRegistry;
0059 uint32_t myCount;
0060 uint32_t myCurrent = 0;
0061 };
0062
0063 #endif