Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:31

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/parser/ExpressionPtr.h"
0027 #include "CommonTools/Utils/interface/parser/ExpressionBase.h"
0028 
0029 // forward declarations
0030 
0031 class FWExpressionEvaluator {
0032 public:
0033   FWExpressionEvaluator(const std::string& iExpression, const std::string& iClassName);
0034   virtual ~FWExpressionEvaluator();
0035 
0036   // ---------- const member functions ---------------------
0037 
0038   const std::string& expression() const;
0039 
0040   double evalExpression(const void*) const;
0041 
0042   // ---------- static member functions --------------------
0043 
0044   // ---------- member functions ---------------------------
0045   /** Throws an FWExpressionException if there is a problem */
0046   void setExpression(const std::string&);
0047   void setClassName(const std::string&);
0048 
0049 private:
0050   //FWExpressionEvaluator(const FWExpressionEvaluator&); // stop default
0051 
0052   //const FWExpressionEvaluator& operator=(const FWExpressionEvaluator&); // stop default
0053 
0054   // ---------- member data --------------------------------
0055   std::string m_expression;
0056   std::string m_className;
0057   reco::parser::ExpressionPtr m_expr;
0058   edm::TypeWithDict m_type;
0059 };
0060 
0061 #endif