/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
FWCore/Reflection/interface/IterWithDict.h
43 строки
1014 B
Chris Jones
Moved code to new FWCore/Reflection package
20 июн 2019, 15:10
20 июн 2019, 15:10
a88734e
Код
Авторство
О чём код?
#ifndef FWCore_Reflection_IterWithDict_h #define FWCore_Reflection_IterWithDict_h /*---------------------------------------------------------------------- IterWithDict: An iterator for a TList so a range for loop can be used ----------------------------------------------------------------------*/ #include "TList.h" namespace edm { class IterWithDictBase { private: TIter iter_; bool atEnd_; protected: void advance(); TIter const& iter() const; public: IterWithDictBase(); explicit IterWithDictBase(TList*); bool operator!=(IterWithDictBase const&) const; }; template <typename T> class IterWithDict : public IterWithDictBase { public: IterWithDict() : IterWithDictBase() {} explicit IterWithDict(TList* list) : IterWithDictBase(list) {} IterWithDict<T>& operator++() { advance(); return *this; } T* operator*() const { return static_cast<T*>(*iter()); } }; } // namespace edm #endif // FWCore_Reflection_IterWithDict_h