OMNeT++ Simulation Library  5.6.1
cNedMathFunction Class Reference

#include <cnedmathfunction.h>

Description

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.

Inheritance diagram for cNedMathFunction:
cNoncopyableOwnedObject cOwnedObject noncopyable cNamedObject cObject

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
 
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
 
- Public Member Functions inherited from cNoncopyableOwnedObject
 cNoncopyableOwnedObject (const char *name=nullptr, bool namepooling=true)
 
virtual cNoncopyableOwnedObjectdup () const override
 
virtual void parsimPack (cCommBuffer *buffer) const override
 
virtual void parsimUnpack (cCommBuffer *buffer) override
 
- Public Member Functions inherited from cOwnedObject
 cOwnedObject ()
 
 cOwnedObject (const char *name, bool namepooling=true)
 
 cOwnedObject (const cOwnedObject &obj)
 
virtual ~cOwnedObject ()
 
cOwnedObjectoperator= (const cOwnedObject &o)
 
virtual cObjectgetOwner () const override
 
virtual bool isOwnedObject () const override
 
virtual bool isSoftOwner () const
 
- Public Member Functions inherited from cNamedObject
 cNamedObject ()
 
 cNamedObject (const char *name, bool namepooling=true)
 
 cNamedObject (const cNamedObject &obj)
 
virtual ~cNamedObject ()
 
cNamedObjectoperator= (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)
 
virtual ~cObject ()
 
virtual const char * getClassName () const
 
bool isName (const char *s) const
 
virtual const char * getFullName () const
 
virtual std::string getFullPath () const
 
const cObjectgetThisPtr () const
 
virtual _OPPDEPRECATED std::string info () const
 
virtual _OPPDEPRECATED std::string detailedInfo () const
 
virtual void forEachChild (cVisitor *v)
 
cObjectfindObject (const char *name, bool deep=true)
 
void copyNotSupported () const
 

Static Public Member Functions

static cNedMathFunctionfind (const char *name, int numArgs)
 
static cNedMathFunctionget (const char *name, int numArgs)
 
static cNedMathFunctionfindByPointer (MathFunc f)
 
- Static Public Member Functions inherited from cOwnedObject
static long getTotalObjectCount ()
 
static long getLiveObjectCount ()
 
static void resetObjectCounters ()
 
static cDefaultListgetDefaultOwner ()
 

Additional Inherited Members

- Protected Member Functions inherited from cObject
virtual void take (cOwnedObject *obj)
 
virtual void drop (cOwnedObject *obj)
 
void dropAndDelete (cOwnedObject *obj)
 

Constructor & Destructor Documentation

◆ cNedMathFunction() [1/5]

cNedMathFunction ( const char *  name,
MathFuncNoArg  f,
int  argc = -1,
const char *  category = nullptr,
const char *  description = nullptr 
)

Constructor.

◆ cNedMathFunction() [2/5]

cNedMathFunction ( const char *  name,
MathFunc1Arg  f,
int  argc = -1,
const char *  category = nullptr,
const char *  description = nullptr 
)

Constructor.

◆ cNedMathFunction() [3/5]

cNedMathFunction ( const char *  name,
MathFunc2Args  f,
int  argc = -1,
const char *  category = nullptr,
const char *  description = nullptr 
)

Constructor.

◆ cNedMathFunction() [4/5]

cNedMathFunction ( const char *  name,
MathFunc3Args  f,
int  argc = -1,
const char *  category = nullptr,
const char *  description = nullptr 
)

Constructor.

◆ cNedMathFunction() [5/5]

cNedMathFunction ( const char *  name,
MathFunc4Args  f,
int  argc = -1,
const char *  category = nullptr,
const char *  description = nullptr 
)

Constructor.

◆ ~cNedMathFunction()

virtual ~cNedMathFunction ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ str()

virtual std::string str ( ) const
overridevirtual

Produces a one-line description of the object's contents.

Reimplemented from cObject.

◆ getNumArgs()

int getNumArgs ( ) const
inline

Argument count to function.

◆ getMathFunc()

MathFunc getMathFunc ( ) const
inline

Returns function pointer as double function with unchecked arg list (no type safety!)

◆ getMathFuncNoArg()

MathFuncNoArg getMathFuncNoArg ( ) const

Returns function pointer as double function with no args. Throws exception if actual arg count is different.

◆ getMathFunc1Arg()

MathFunc1Arg getMathFunc1Arg ( ) const

Returns function pointer as double function with 1 double arg. Throws exception if actual arg count is different.

◆ getMathFunc2Args()

MathFunc2Args getMathFunc2Args ( ) const

Returns function pointer as double function with 2 double args. Throws exception if actual arg count is different.

◆ getMathFunc3Args()

MathFunc3Args getMathFunc3Args ( ) const

Returns function pointer as double function with 3 double args. Throws exception if actual arg count is different.

◆ getMathFunc4Args()

MathFunc4Args getMathFunc4Args ( ) const

Returns function pointer as double function with 4 double args. Throws exception if actual arg count is different.

◆ getCategory()

const char* getCategory ( ) const
inline

Returns a string that can be useful in classifying NED functions, e.g. "trigonometric".

◆ getDescription()

const char* getDescription ( ) const
inline

Returns the function's documentation as a string.

◆ find()

static cNedMathFunction* find ( const char *  name,
int  numArgs 
)
static

Finds a registered function by name. Returns nullptr if not found.

◆ get()

static cNedMathFunction* get ( const char *  name,
int  numArgs 
)
static

Finds a registered function by name. Throws an error if not found.

◆ findByPointer()

static cNedMathFunction* findByPointer ( MathFunc  f)
static

Finds a registered function by function pointer.


The documentation for this class was generated from the following file: