35 std::shared_ptr<ResourceIterator> iterator_object;
37 std::shared_ptr<Resource> operator *()
39 return iterator_object->Get();
44 iterator_object->Step();
48 bool operator !=(
const Iterator& other)
const
50 return !iterator_object->SameAs(other.iterator_object.get());
56 std::shared_ptr<const ResourceIterator> iterator_object;
58 std::shared_ptr<const Resource> operator *()
60 return iterator_object->Get();
65 iterator_object->Step();
71 return !iterator_object->SameAs(other.iterator_object.get());
75 virtual std::shared_ptr<ResourceIterator> BeginIteration() = 0;
76 std::shared_ptr<const ResourceIterator> BeginIteration()
const
78 return std::const_pointer_cast<const ResourceIterator>(
const_cast<ResourceIterable *
>(
this)->BeginIteration());
80 virtual std::shared_ptr<ResourceIterator> EndOfIteration() = 0;
81 std::shared_ptr<const ResourceIterator> EndOfIteration()
const
83 return std::const_pointer_cast<const ResourceIterator>(
const_cast<ResourceIterable *
>(
this)->EndOfIteration());
86 ConstIterator begin()
const
88 return ConstIterator{BeginIteration()};
91 ConstIterator end()
const
93 return ConstIterator{EndOfIteration()};
98 return Iterator{BeginIteration()};
103 return Iterator{EndOfIteration()};