/*============================================================================== Copyright 2018 by Roland Rabien For more information visit www.rabiensoftware.com ==============================================================================*/ #pragma once class EquationParser { public: EquationParser(); EquationParser (juce::String equation); ~EquationParser(); void setEquation (juce::String equation); void addVariable (juce::String name, double* value); void addConstant (juce::String name, double value); void addFunction (juce::String name, std::function fun); void addFunction (juce::String name, std::function fun); void addFunction (juce::String name, std::function fun); void addFunction (juce::String name, std::function fun); void addFunction (juce::String name, std::function fun); double evaluate(); bool hasError(); juce::String getError(); private: class Callback { public: virtual ~Callback() = default; }; class Callback0; class Callback1; class Callback2; class Callback3; class Callback4; OwnedArray callbacks; class EquationParserImpl; std::unique_ptr impl; juce::String errorMessage; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (EquationParser) };