CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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.3 $
11  *
12  */
17 #include <boost/shared_ptr.hpp>
18 
19 namespace reco {
20  namespace parser {
22  public:
24  ComparisonStack& cmpStack,
25  ExpressionStack& expStack) :
26  selStack_(selStack), cmpStack_(cmpStack), expStack_(expStack) { }
27 
28  void operator()(const char *, const char *) const {
29  boost::shared_ptr<ExpressionBase> rhs = expStack_.back(); expStack_.pop_back();
30  boost::shared_ptr<ExpressionBase> mid = expStack_.back(); expStack_.pop_back();
31  boost::shared_ptr<ExpressionBase> lhs = expStack_.back(); expStack_.pop_back();
32  boost::shared_ptr<ComparisonBase> comp2 = cmpStack_.back(); cmpStack_.pop_back();
33  boost::shared_ptr<ComparisonBase> comp1 = cmpStack_.back(); cmpStack_.pop_back();
34 #ifdef BOOST_SPIRIT_DEBUG
35  BOOST_SPIRIT_DEBUG_OUT << "pushing trinary selector" << std::endl;
36 #endif
37  selStack_.push_back(SelectorPtr(new TrinarySelector(lhs, comp1, mid, comp2, rhs)));
38  }
39  private:
43  };
44  }
45 }
46 
47 #endif
TrinarySelectorSetter(SelectorStack &selStack, ComparisonStack &cmpStack, ExpressionStack &expStack)
std::vector< boost::shared_ptr< ExpressionBase > > ExpressionStack
std::vector< SelectorPtr > SelectorStack
Definition: SelectorStack.h:18
boost::shared_ptr< SelectorBase > SelectorPtr
Definition: SelectorPtr.h:17
void operator()(const char *, const char *) const
std::vector< boost::shared_ptr< ComparisonBase > > ComparisonStack