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
std::vector< std::shared_ptr< ComparisonBase > > ComparisonStack
TrinarySelectorSetter(SelectorStack &selStack, ComparisonStack &cmpStack, ExpressionStack &expStack)
std::vector< std::shared_ptr< ExpressionBase > > ExpressionStack
std::vector< SelectorPtr > SelectorStack
Definition: SelectorStack.h:18
void operator()(const char *, const char *) const
fixed size matrix
std::shared_ptr< SelectorBase > SelectorPtr
Definition: SelectorPtr.h:18