OMNeT++ Simulation Library  6.0.3
cDynamicExpression::IResolver Class Referenceabstract

#include <cdynamicexpression.h>

Description

Interface for extending cDynamicExpression with support for variables, member access, (extra) function calls, and method calls. If a variable/member/etc was not found, the corresponding method should return cValue(), i.e. the "undefined" value.

Inheritance diagram for cDynamicExpression::IResolver:
cDynamicExpression::SymbolTable

Public Member Functions

virtual IResolverdup () const =0
 
Evaluator methods.
virtual cValue readVariable (Context *context, const char *name)
 
virtual cValue readVariable (Context *context, const char *name, intval_t index)
 
virtual cValue readMember (Context *context, const cValue &object, const char *name)
 
virtual cValue readMember (Context *context, const cValue &object, const char *name, intval_t index)
 
virtual cValue callFunction (Context *context, const char *name, cValue argv[], int argc)
 
virtual cValue callMethod (Context *context, const cValue &object, const char *name, cValue argv[], int argc)
 

Member Function Documentation

◆ dup()

virtual IResolver* dup ( ) const
pure virtual

Create and return an exact copy of this object.

Implemented in cDynamicExpression::SymbolTable.

◆ readVariable() [1/2]

virtual cValue readVariable ( Context context,
const char *  name 
)
inlinevirtual

Return the value of a variable with the given name.

Reimplemented in cDynamicExpression::SymbolTable.

◆ readVariable() [2/2]

virtual cValue readVariable ( Context context,
const char *  name,
intval_t  index 
)
inlinevirtual

Return the value of an element of an array variable with the given name. Expression syntax: name[index]

Reimplemented in cDynamicExpression::SymbolTable.

◆ readMember() [1/2]

virtual cValue readMember ( Context context,
const cValue object,
const char *  name 
)
inlinevirtual

Return the value of a member of the given object. Expression syntax: object.name

◆ readMember() [2/2]

virtual cValue readMember ( Context context,
const cValue object,
const char *  name,
intval_t  index 
)
inlinevirtual

Return the value of an element of an array member of the given object. Expression syntax: object.name[index]

◆ callFunction()

virtual cValue callFunction ( Context context,
const char *  name,
cValue  argv[],
int  argc 
)
inlinevirtual

Evaluate a function call with the given arguments. Expression syntax: name(argv0, argv1,...)

◆ callMethod()

virtual cValue callMethod ( Context context,
const cValue object,
const char *  name,
cValue  argv[],
int  argc 
)
inlinevirtual

Evaluate a method call on the given object with the given arguments. Expression syntax: object.name(argv0, argv1,...)


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