Registration class for extending NED with new mathematical functions.
Objects of this class are usually created via the Define_NED_Math_Function() macro. It stores a pointer to a function taking up to 4 doubles as args and returning a double.
Public Member Functions | |
Constructors, destructor, assignment | |
cNedMathFunction (const char *name, MathFuncNoArg f, int argc=-1, const char *category=nullptr, const char *description=nullptr) | |
cNedMathFunction (const char *name, MathFunc1Arg f, int argc=-1, const char *category=nullptr, const char *description=nullptr) | |
cNedMathFunction (const char *name, MathFunc2Args f, int argc=-1, const char *category=nullptr, const char *description=nullptr) | |
cNedMathFunction (const char *name, MathFunc3Args f, int argc=-1, const char *category=nullptr, const char *description=nullptr) | |
cNedMathFunction (const char *name, MathFunc4Args f, int argc=-1, const char *category=nullptr, const char *description=nullptr) | |
virtual | ~cNedMathFunction () |
Redefined cObject member functions. | |
virtual std::string | str () const override |
Public Member Functions inherited from cNoncopyableOwnedObject | |
cNoncopyableOwnedObject (const char *name=nullptr, bool namepooling=true) | |
virtual cNoncopyableOwnedObject * | dup () const override |
Public Member Functions inherited from cOwnedObject | |
cOwnedObject () | |
cOwnedObject (const char *name, bool namepooling=true) | |
cOwnedObject (const cOwnedObject &obj) | |
virtual | ~cOwnedObject () |
cOwnedObject & | operator= (const cOwnedObject &o) |
virtual cObject * | getOwner () const override |
virtual bool | isOwnedObject () const override |
Public Member Functions inherited from cNamedObject | |
cNamedObject () | |
cNamedObject (const char *name, bool namepooling=true) | |
cNamedObject (const cNamedObject &obj) | |
virtual | ~cNamedObject () |
cNamedObject & | operator= (const cNamedObject &o) |
virtual void | setName (const char *s) |
virtual const char * | getName () const override |
virtual void | setNamePooling (bool b) |
virtual bool | getNamePooling () |
Public Member Functions inherited from cObject | |
cObject () | |
cObject (const cObject &other)=default | |
virtual | ~cObject () |
virtual const char * | getClassName () const |
bool | isName (const char *s) const |
virtual const char * | getFullName () const |
virtual std::string | getFullPath () const |
virtual std::string | getClassAndFullName () const |
virtual std::string | getClassAndFullPath () const |
const cObject * | getThisPtr () const |
virtual std::ostream & | printOn (std::ostream &os) const |
virtual bool | isSoftOwner () const |
virtual void | forEachChild (cVisitor *v) |
cObject * | findObject (const char *name, bool deep=true) |
virtual cClassDescriptor * | getDescriptor () const |
void | copyNotSupported () 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 cNedMathFunction * | find (const char *name, int numArgs) |
static cNedMathFunction * | get (const char *name, int numArgs) |
static cNedMathFunction * | findByPointer (MathFunc f) |
Additional Inherited Members | |
Static Public Member Functions inherited from cOwnedObject | |
static long | getTotalObjectCount () |
static long | getLiveObjectCount () |
static void | resetObjectCounters () |
static cSoftOwner * | getOwningContext () |
Protected Member Functions inherited from cObject | |
virtual void | take (cOwnedObject *obj) |
virtual void | drop (cOwnedObject *obj) |
void | dropAndDelete (cOwnedObject *obj) |
cNedMathFunction | ( | const char * | name, |
MathFuncNoArg | f, | ||
int | argc = -1 , |
||
const char * | category = nullptr , |
||
const char * | description = nullptr |
||
) |
Constructor.
cNedMathFunction | ( | const char * | name, |
MathFunc1Arg | f, | ||
int | argc = -1 , |
||
const char * | category = nullptr , |
||
const char * | description = nullptr |
||
) |
Constructor.
cNedMathFunction | ( | const char * | name, |
MathFunc2Args | f, | ||
int | argc = -1 , |
||
const char * | category = nullptr , |
||
const char * | description = nullptr |
||
) |
Constructor.
cNedMathFunction | ( | const char * | name, |
MathFunc3Args | f, | ||
int | argc = -1 , |
||
const char * | category = nullptr , |
||
const char * | description = nullptr |
||
) |
Constructor.
cNedMathFunction | ( | const char * | name, |
MathFunc4Args | f, | ||
int | argc = -1 , |
||
const char * | category = nullptr , |
||
const char * | description = nullptr |
||
) |
Constructor.
|
inlinevirtual |
Destructor.
|
overridevirtual |
Produces a one-line description of the object's contents.
Reimplemented from cObject.
|
inline |
Argument count to function.
|
inline |
Returns function pointer as double function with unchecked arg list (no type safety!)
MathFuncNoArg getMathFuncNoArg | ( | ) | const |
Returns function pointer as double function with no args. Throws exception if actual arg count is different.
MathFunc1Arg getMathFunc1Arg | ( | ) | const |
Returns function pointer as double function with 1 double arg. Throws exception if actual arg count is different.
MathFunc2Args getMathFunc2Args | ( | ) | const |
Returns function pointer as double function with 2 double args. Throws exception if actual arg count is different.
MathFunc3Args getMathFunc3Args | ( | ) | const |
Returns function pointer as double function with 3 double args. Throws exception if actual arg count is different.
MathFunc4Args getMathFunc4Args | ( | ) | const |
Returns function pointer as double function with 4 double args. Throws exception if actual arg count is different.
|
inline |
Returns a string that can be useful in classifying NED functions, e.g. "trigonometric".
|
inline |
Returns the function's documentation as a string.
|
static |
Finds a registered function by name. Returns nullptr if not found.
|
static |
Finds a registered function by name. Throws an error if not found.
|
static |
Finds a registered function by function pointer.