CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CutSetter.h
Go to the documentation of this file.
1 #ifndef CommonTools_Utils_CutSetter_h
2 #define CommonTools_Utils_CutSetter_h
3 /* \class reco::parser::CutSetter
4  *
5  * Cut setter
6  *
7  * \author original version: Chris Jones, Cornell,
8  * adapted by Luca Lista, INFN
9  *
10  * \version $Revision: 1.3 $
11  *
12  */
15 #include <cassert>
16 
17 namespace reco {
18  namespace parser {
19  struct CutSetter {
20  CutSetter(SelectorPtr& cut, SelectorStack& selStack) : cut_(cut), selStack_(selStack) {}
21 
22  void operator()(const char*, const char*) const {
23  assert(nullptr == cut_.get());
24  assert(!selStack_.empty());
25  cut_ = selStack_.back();
26  selStack_.pop_back();
27  }
30  };
31  } // namespace parser
32 } // namespace reco
33 
34 #endif
SelectorStack & selStack_
Definition: CutSetter.h:29
CutSetter(SelectorPtr &cut, SelectorStack &selStack)
Definition: CutSetter.h:20
assert(be >=bs)
SelectorPtr & cut_
Definition: CutSetter.h:28
void operator()(const char *, const char *) const
Definition: CutSetter.h:22
std::vector< SelectorPtr > SelectorStack
Definition: SelectorStack.h:18
std::shared_ptr< SelectorBase > SelectorPtr
Definition: SelectorPtr.h:18