Registration class for extending NED with new functions. More...
#include <cnedmathfunction.h>
Public Member Functions | |
Constructors, destructor, assignment | |
cNEDMathFunction (const char *name, MathFuncNoArg f, int argc=-1, const char *category=NULL, const char *description=NULL) | |
cNEDMathFunction (const char *name, MathFunc1Arg f, int argc=-1, const char *category=NULL, const char *description=NULL) | |
cNEDMathFunction (const char *name, MathFunc2Args f, int argc=-1, const char *category=NULL, const char *description=NULL) | |
cNEDMathFunction (const char *name, MathFunc3Args f, int argc=-1, const char *category=NULL, const char *description=NULL) | |
cNEDMathFunction (const char *name, MathFunc4Args f, int argc=-1, const char *category=NULL, const char *description=NULL) | |
virtual | ~cNEDMathFunction () |
Redefined cObject member functions. | |
virtual std::string | info () const |
Member access. | |
int | getNumArgs () const |
MathFunc | getMathFunc () const |
MathFuncNoArg | getMathFuncNoArg () const |
MathFunc1Arg | getMathFunc1Arg () const |
MathFunc2Args | getMathFunc2Args () const |
MathFunc3Args | getMathFunc3Args () const |
MathFunc4Args | getMathFunc4Args () const |
const char * | getCategory () const |
const char * | getDescription () const |
Static Public Member Functions | |
static cNEDMathFunction * | find (const char *name, int numArgs) |
static cNEDMathFunction * | get (const char *name, int numArgs) |
static cNEDMathFunction * | findByPointer (MathFunc f) |
Registration class for extending NED with new functions.
Stores a pointer to a function taking up to 4 doubles as args and returning a double.
Objects of this class are usually created via the Define_NED_Math_Function() macro.
static cNEDMathFunction* cNEDMathFunction::find | ( | const char * | name, | |
int | numArgs | |||
) | [static] |
Finds a registered function by name.
Returns NULL if not found.
static cNEDMathFunction* cNEDMathFunction::get | ( | const char * | name, | |
int | numArgs | |||
) | [static] |
Finds a registered function by name.
Throws an error if not found.
const char* cNEDMathFunction::getCategory | ( | ) | const [inline] |
Returns a string that can be useful in classifying NED functions, e.g.
"trigonometric".
MathFunc1Arg cNEDMathFunction::getMathFunc1Arg | ( | ) | const |
Returns function pointer as double function with 1 double arg.
Throws exception is actual arg count is different.
MathFunc2Args cNEDMathFunction::getMathFunc2Args | ( | ) | const |
Returns function pointer as double function with 2 double args.
Throws exception is actual arg count is different.
MathFunc3Args cNEDMathFunction::getMathFunc3Args | ( | ) | const |
Returns function pointer as double function with 3 double args.
Throws exception is actual arg count is different.
MathFunc4Args cNEDMathFunction::getMathFunc4Args | ( | ) | const |
Returns function pointer as double function with 4 double args.
Throws exception is actual arg count is different.
MathFuncNoArg cNEDMathFunction::getMathFuncNoArg | ( | ) | const |
Returns function pointer as double function with no args.
Throws exception is actual arg count is different.