Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-05 22:48:06

0001 // -*- C++ -*-
0002 #ifndef Fireworks_Core_FWExpressionEvaluator_h
0003 #define Fireworks_Core_FWExpressionEvaluator_h
0004 //
0005 // Package:     Core
0006 // Class  :     FWExpressionEvaluator
0007 //
0008 /**\class FWExpressionEvaluator FWExpressionEvaluator.h Fireworks/Core/interface/FWExpressionEvaluator.h
0009 
0010    Description: <one line class summary>
0011 
0012    Usage:
0013     <usage>
0014 
0015  */
0016 //
0017 // Original Author:  Chris Jones
0018 //         Created:  Fri Feb 29 13:39:51 PST 2008
0019 //
0020 
0021 // system include files
0022 #include <string>
0023 #include "FWCore/Reflection/interface/TypeWithDict.h"
0024 
0025 // user include files
0026 #include "CommonTools/Utils/interface/SelectorPtr.h"
0027 #include "CommonTools/Utils/interface/SelectorBase.h"
0028 #include "CommonTools/Utils/interface/ExpressionPtr.h"
0029 #include "CommonTools/Utils/interface/ExpressionBase.h"
0030 
0031 // forward declarations
0032 
0033 class FWExpressionEvaluator {
0034 public:
0035   FWExpressionEvaluator(const std::string& iExpression, const std::string& iClassName);
0036   virtual ~FWExpressionEvaluator();
0037 
0038   // ---------- const member functions ---------------------
0039 
0040   const std::string& expression() const;
0041 
0042   double evalExpression(const void*) const;
0043 
0044   // ---------- static member functions --------------------
0045 
0046   // ---------- member functions ---------------------------
0047   /** Throws an FWExpressionException if there is a problem */
0048   void setExpression(const std::string&);
0049   void setClassName(const std::string&);
0050 
0051 private:
0052   //FWExpressionEvaluator(const FWExpressionEvaluator&); // stop default
0053 
0054   //const FWExpressionEvaluator& operator=(const FWExpressionEvaluator&); // stop default
0055 
0056   // ---------- member data --------------------------------
0057   std::string m_expression;
0058   std::string m_className;
0059   reco::parser::ExpressionPtr m_expr;
0060   edm::TypeWithDict m_type;
0061 };
0062 
0063 #endif