Go to the documentation of this file.00001 #ifndef CommonTools_Utils_ComparisonSetter_h
00002 #define CommonTools_Utils_ComparisonSetter_h
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "CommonTools/Utils/src/ComparisonStack.h"
00014 #include "CommonTools/Utils/src/Comparison.h"
00015 #ifdef BOOST_SPIRIT_DEBUG
00016 #include <iostream>
00017 #include <string>
00018 #endif
00019
00020 namespace reco {
00021 namespace parser {
00022 #ifdef BOOST_SPIRIT_DEBUG
00023 template <typename Op> struct cmp_out { static const std::string value; };
00024 #endif
00025
00026 template<class CompT>
00027 struct ComparisonSetter {
00028 ComparisonSetter(ComparisonStack & stack) : stack_(stack) { }
00029 void operator()(const char) const {
00030 #ifdef BOOST_SPIRIT_DEBUG
00031 BOOST_SPIRIT_DEBUG_OUT << "pushing comparison: " << cmp_out<CompT>::value << std::endl;
00032 #endif
00033 stack_.push_back(boost::shared_ptr<ComparisonBase>(new Comparison<CompT>()));
00034 }
00035 private:
00036 ComparisonStack & stack_;
00037 };
00038 }
00039 }
00040
00041 #endif