Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:01:17

0001 #ifndef CommonTools_Utils_ExpressionUnaryOperatorSetter_h
0002 #define CommonTools_Utils_ExpressionUnaryOperatorSetter_h
0003 /* \class reco::parser::ExpressionUnaryOperator
0004  *
0005  * Unary Operator expression setter
0006  *
0007  * \author original version: Chris Jones, Cornell, 
0008  *         adapted by Luca Lista, INFN
0009  *
0010  * \version $Revision: 1.2 $
0011  *
0012  */
0013 #include "CommonTools/Utils/interface/parser/ExpressionUnaryOperator.h"
0014 #include "CommonTools/Utils/interface/parser/ExpressionStack.h"
0015 #ifdef BOOST_SPIRIT_DEBUG
0016 #include <string>
0017 #include <iostream>
0018 #endif
0019 namespace reco {
0020   namespace parser {
0021 
0022 #ifdef BOOST_SPIRIT_DEBUG
0023     template <typename Op>
0024     struct op1_out {
0025       static const std::string value;
0026     };
0027 #endif
0028 
0029     template <typename Op>
0030     struct ExpressionUnaryOperatorSetter {
0031       ExpressionUnaryOperatorSetter(ExpressionStack& stack) : stack_(stack) {}
0032       void operator()(const char*, const char*) const {
0033 #ifdef BOOST_SPIRIT_DEBUG
0034         BOOST_SPIRIT_DEBUG_OUT << "pushing unary operator" << op1_out<Op>::value << std::endl;
0035 #endif
0036         stack_.push_back(ExpressionPtr(new ExpressionUnaryOperator<Op>(stack_)));
0037       }
0038 
0039     private:
0040       ExpressionStack& stack_;
0041     };
0042   }  // namespace parser
0043 }  // namespace reco
0044 
0045 #endif