|
OMNeT++ API 6.1
Discrete Event Simulation Library
|
|
16 #ifndef __OMNETPP_CNEDFUNCTION_H
17 #define __OMNETPP_CNEDFUNCTION_H
20 #include "simkerneldefs.h"
22 #include "cownedobject.h"
23 #include "cdynamicexpression.h"
63 enum Type { UNDEF=0, BOOL, INT, INTQ, DOUBLE, DOUBLEQ, STRING, OBJECT, XML, ANY };
66 std::string signature;
67 std::vector<Type> argTypes;
74 std::string description;
77 void parseSignature(
const char *signature);
78 void checkArgs(
cValue argv[],
int argc);
99 cNedFunction(
NedFunction f,
const char *signature,
const char *category=
nullptr,
const char *description=
nullptr);
119 virtual std::string str()
const override;
173 bool acceptsArgCount(
int argCount) {
return argCount >= minArgc && (hasVarargs_ || argCount <= maxArgc);}
196 static cNedFunction *find(
const char *name,
int argCount);
207 static cNedFunction *get(
const char *name,
int argCount);
216 typedef cNedFunction cNEDFunction;
A variant-like value class used during evaluating NED expressions.
Definition: cvalue.h:47
const char * getCategory() const
Definition: cnedfunction.h:179
cValue(* NedFunctionExt)(cExpression::Context *context, cValue argv[], int argc)
One of the two function signatures that can be used with cDynamicExpression. This one is more generic...
Definition: cnedfunction.h:46
NedFunction getFunctionPointer() const
Definition: cnedfunction.h:133
const char * getDescription() const
Definition: cnedfunction.h:184
int getMaxArgs() const
Definition: cnedfunction.h:161
const char * getSignature() const
Definition: cnedfunction.h:138
Contextual information for evaluating the expression.
Definition: cexpression.h:39
Registration class for extending NED with arbitrary new functions.
Definition: cnedfunction.h:60
Type getReturnType() const
Definition: cnedfunction.h:143
virtual ~cNedFunction()
Definition: cnedfunction.h:111
Type getArgType(int k) const
Definition: cnedfunction.h:148
int getMinArgs() const
Definition: cnedfunction.h:154
Common base for module and channel classes.
Definition: ccomponent.h:49
cValue(* NedFunction)(cComponent *context, cValue argv[], int argc)
One of the two function signatures that can be used with cDynamicExpression. This one can be used wit...
Definition: cnedfunction.h:36
bool acceptsArgCount(int argCount)
Definition: cnedfunction.h:173
Base class for cOwnedObject-based classes that do not wish to support assignment and duplication.
Definition: cownedobject.h:242
bool hasVarArgs() const
Definition: cnedfunction.h:167