6 #ifndef __PLOTFUNCTIONREGISTER_H_
7 #define __PLOTFUNCTIONREGISTER_H_
9 #include "plotsconfig.h"
11 #include "plotfunction.h"
13 #include "functionsimple.h"
15 #include <QStringList>
73 inline const QVector<FunctionDefinition *> &
definitions()
const {
return _definitions; }
77 inline const QStringList
categories()
const {
return _categories; }
91 QVector<FunctionDefinition *> _definitions;
92 QStringList _categories;
93 QVector<bool> _ownership;
96 #endif // __PLOTFUNCTIONREGISTER_H_
void(* ExpandedFunctionPtr)(PlotFunctionResult &result, double time, unsigned int argc, const double *argv, const PlotFunctionInfo &info)
ExpandedFunction typedef to a C function.
Definition: functionsimple.h:36
double(* ValueFunctionPtr)(double)
ValueFunction typedef to a C function.
Definition: functionsimple.h:31
const QStringList categories() const
Return the list of category names which covers all registered functions.
Definition: plotfunctionregister.h:77
void ensureCategoryIsPresent(const QString &categoryName)
Ensure that categoryName is present in the list of categories.
FunctionSimple * add(FunctionSimple::ValueFunctionPtr function, const QString &category, const QString &name, const QString &description)
Add a function to the register using a FunctionSimple object with a FunctionSimple::ValueFunction imp...
A PlotFunctionRegister stores function implementations to expose to the plot expression generator...
Definition: plotfunctionregister.h:26
const FunctionDefinition * find(const QString &name) const
Search for a function by name : exact match with FunctionDefinition::name().
void registerDefaultFunctions()
Register built in functions. May have already been called from the constructor.
unsigned getDefinitionsInCategory(const QString &categoryName, QVector< const FunctionDefinition * > &definitions) const
Request definitions in a particular category.
~PlotFunctionRegister()
Destructor. Destroys all functions which the register owns.
Defines a function which can be used with the FunctionRegister.
Definition: functiondefinition.h:34
Defines a function which is implemented by a given function object.
Definition: functionsimple.h:25
const QVector< FunctionDefinition * > & definitions() const
Fetch all registered functions.
Definition: plotfunctionregister.h:73
PlotFunctionRegister(bool registerDefaults=true)
Constructor - optinally register default/built-in functions.