Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef CommonTools_Utils_LogicalBinaryOperator_h
0002 #define CommonTools_Utils_LogicalBinaryOperator_h
0003 /* \class reco::parser::LogicalBinaryOperator
0004  *
0005  * logical AND combiner
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/SelectorBase.h"
0014 #include "CommonTools/Utils/interface/parser/SelectorStack.h"
0015 
0016 namespace reco {
0017   namespace parser {
0018     template <typename Op>
0019     struct LogicalBinaryOperator : public SelectorBase {
0020       LogicalBinaryOperator(SelectorStack &selStack) {
0021         rhs_ = selStack.back();
0022         selStack.pop_back();
0023         lhs_ = selStack.back();
0024         selStack.pop_back();
0025       }
0026       bool operator()(const edm::ObjectWithDict &o) const override;
0027 
0028     private:
0029       Op op_;
0030       SelectorPtr lhs_, rhs_;
0031     };
0032 
0033     template <>
0034     bool LogicalBinaryOperator<std::logical_and<bool> >::operator()(const edm::ObjectWithDict &o) const;
0035     template <>
0036     bool LogicalBinaryOperator<std::logical_or<bool> >::operator()(const edm::ObjectWithDict &o) const;
0037   }  // namespace parser
0038 }  // namespace reco
0039 
0040 #endif