FWExpressionEvaluator

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
// -*- C++ -*-
#ifndef Fireworks_Core_FWExpressionEvaluator_h
#define Fireworks_Core_FWExpressionEvaluator_h
//
// Package:     Core
// Class  :     FWExpressionEvaluator
//
/**\class FWExpressionEvaluator FWExpressionEvaluator.h Fireworks/Core/interface/FWExpressionEvaluator.h

   Description: <one line class summary>

   Usage:
    <usage>

 */
//
// Original Author:  Chris Jones
//         Created:  Fri Feb 29 13:39:51 PST 2008
//

// system include files
#include <string>
#include "FWCore/Reflection/interface/TypeWithDict.h"

// user include files
#include "CommonTools/Utils/interface/parser/ExpressionPtr.h"
#include "CommonTools/Utils/interface/parser/ExpressionBase.h"

// forward declarations

class FWExpressionEvaluator {
public:
  FWExpressionEvaluator(const std::string& iExpression, const std::string& iClassName);
  virtual ~FWExpressionEvaluator();

  // ---------- const member functions ---------------------

  const std::string& expression() const;

  double evalExpression(const void*) const;

  // ---------- static member functions --------------------

  // ---------- member functions ---------------------------
  /** Throws an FWExpressionException if there is a problem */
  void setExpression(const std::string&);
  void setClassName(const std::string&);

private:
  //FWExpressionEvaluator(const FWExpressionEvaluator&); // stop default

  //const FWExpressionEvaluator& operator=(const FWExpressionEvaluator&); // stop default

  // ---------- member data --------------------------------
  std::string m_expression;
  std::string m_className;
  reco::parser::ExpressionPtr m_expr;
  edm::TypeWithDict m_type;
};

#endif