CMS 3D CMS Logo

TrinarySelectorSetter.h
Go to the documentation of this file.
1 #ifndef CommonTools_Utils_TrinarySelectorSetter_h
2 #define CommonTools_Utils_TrinarySelectorSetter_h
3 /* \class reco::parser::TrinarySelectorSetter
4  *
5  * Trinary selector setter
6  *
7  * \author original version: Chris Jones, Cornell,
8  * adapted by Luca Lista, INFN
9  *
10  * \version $Revision: 1.2 $
11  *
12  */
17 
18 namespace reco {
19  namespace parser {
21  public:
23  : selStack_(selStack), cmpStack_(cmpStack), expStack_(expStack) {}
24 
25  void operator()(const char*, const char*) const {
26  std::shared_ptr<ExpressionBase> rhs = expStack_.back();
27  expStack_.pop_back();
28  std::shared_ptr<ExpressionBase> mid = expStack_.back();
29  expStack_.pop_back();
30  std::shared_ptr<ExpressionBase> lhs = expStack_.back();
31  expStack_.pop_back();
32  std::shared_ptr<ComparisonBase> comp2 = cmpStack_.back();
33  cmpStack_.pop_back();
34  std::shared_ptr<ComparisonBase> comp1 = cmpStack_.back();
35  cmpStack_.pop_back();
36 #ifdef BOOST_SPIRIT_DEBUG
37  BOOST_SPIRIT_DEBUG_OUT << "pushing trinary selector" << std::endl;
38 #endif
39  selStack_.push_back(SelectorPtr(new TrinarySelector(lhs, comp1, mid, comp2, rhs)));
40  }
41 
42  private:
46  };
47  } // namespace parser
48 } // namespace reco
49 
50 #endif
TrinarySelector.h
SelectorStack.h
writedatasetfile.parser
parser
Definition: writedatasetfile.py:7
reco::parser::TrinarySelectorSetter
Definition: TrinarySelectorSetter.h:20
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
ExpressionStack.h
reco::parser::TrinarySelectorSetter::cmpStack_
ComparisonStack & cmpStack_
Definition: TrinarySelectorSetter.h:44
reco::parser::TrinarySelectorSetter::operator()
void operator()(const char *, const char *) const
Definition: TrinarySelectorSetter.h:25
reco::parser::TrinarySelectorSetter::expStack_
ExpressionStack & expStack_
Definition: TrinarySelectorSetter.h:45
ComparisonStack.h
reco::parser::TrinarySelectorSetter::TrinarySelectorSetter
TrinarySelectorSetter(SelectorStack &selStack, ComparisonStack &cmpStack, ExpressionStack &expStack)
Definition: TrinarySelectorSetter.h:22
reco::parser::TrinarySelectorSetter::selStack_
SelectorStack & selStack_
Definition: TrinarySelectorSetter.h:43
reco::parser::SelectorPtr
std::shared_ptr< SelectorBase > SelectorPtr
Definition: SelectorPtr.h:18
reco::parser::ExpressionStack
std::vector< std::shared_ptr< ExpressionBase > > ExpressionStack
Definition: ExpressionStack.h:19
reco::parser::ComparisonStack
std::vector< std::shared_ptr< ComparisonBase > > ComparisonStack
Definition: ComparisonStack.h:19
reco::parser::TrinarySelector
Definition: TrinarySelector.h:19
reco::parser::SelectorStack
std::vector< SelectorPtr > SelectorStack
Definition: SelectorStack.h:18