File indexing completed on 2024-04-06 12:01:17
0001 #ifndef CommonTools_Utils_CutSetter_h
0002 #define CommonTools_Utils_CutSetter_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #include "CommonTools/Utils/interface/parser/SelectorPtr.h"
0014 #include "CommonTools/Utils/interface/parser/SelectorStack.h"
0015 #include <cassert>
0016
0017 namespace reco {
0018 namespace parser {
0019 struct CutSetter {
0020 CutSetter(SelectorPtr& cut, SelectorStack& selStack) : cut_(cut), selStack_(selStack) {}
0021
0022 void operator()(const char*, const char*) const {
0023 assert(nullptr == cut_.get());
0024 assert(!selStack_.empty());
0025 cut_ = selStack_.back();
0026 selStack_.pop_back();
0027 }
0028 SelectorPtr& cut_;
0029 SelectorStack& selStack_;
0030 };
0031 }
0032 }
0033
0034 #endif