Yate
Public Member Functions | List of all members
ExpExtender Class Reference

ExpEvaluator extending interface. More...

#include <yatescript.h>

Inheritance diagram for ExpExtender:
ScriptContext JsObject JsArray JsFunction JsRegExp

Public Member Functions

virtual ~ExpExtender ()
 
virtual RefObjectrefObj ()
 
virtual bool hasField (ObjList &stack, const String &name, GenObject *context) const
 
virtual NamedStringgetField (ObjList &stack, const String &name, GenObject *context) const
 
virtual bool runFunction (ObjList &stack, const ExpOperation &oper, GenObject *context)
 
virtual bool runField (ObjList &stack, const ExpOperation &oper, GenObject *context)
 
virtual bool runAssign (ObjList &stack, const ExpOperation &oper, GenObject *context)
 

Detailed Description

ExpEvaluator extending interface.

This class allows extending ExpEvaluator to implement custom fields and functions

Constructor & Destructor Documentation

◆ ~ExpExtender()

virtual ~ExpExtender ( )
inlinevirtual

Destructor

Member Function Documentation

◆ getField()

virtual NamedString * getField ( ObjList stack,
const String name,
GenObject context 
) const
virtual

Get a pointer to a field in extender

Parameters
stackEvaluation stack in use
nameName of the field to retrieve
contextPointer to arbitrary object passed from evaluation methods
Returns
Pointer to field, NULL if not present

Reimplemented in ScriptContext, and JsObject.

◆ hasField()

virtual bool hasField ( ObjList stack,
const String name,
GenObject context 
) const
virtual

Check if a certain field is assigned in extender

Parameters
stackEvaluation stack in use
nameName of the field to test
contextPointer to arbitrary object passed from evaluation methods
Returns
True if the field is present

Reimplemented in ScriptContext, and JsObject.

◆ refObj()

virtual RefObject * refObj ( )
virtual

Retrieve the reference counted object owning this interface

Returns
Pointer to object owning the extender, NULL if no ownership

Reimplemented in ScriptContext.

◆ runAssign()

virtual bool runAssign ( ObjList stack,
const ExpOperation oper,
GenObject context 
)
virtual

Try to assign a value to a single field

Parameters
stackEvaluation stack in use
operField to assign to, contains the field name and new value
contextPointer to arbitrary object passed from evaluation methods
Returns
True if assignment succeeded

Reimplemented in ScriptContext, JsObject, JsArray, and JsRegExp.

◆ runField()

virtual bool runField ( ObjList stack,
const ExpOperation oper,
GenObject context 
)
virtual

Try to evaluate a single field

Parameters
stackEvaluation stack in use, field value must be pushed on it
operField to evaluate
contextPointer to arbitrary object passed from evaluation methods
Returns
True if evaluation succeeded

Reimplemented in ScriptContext, JsObject, and JsArray.

◆ runFunction()

virtual bool runFunction ( ObjList stack,
const ExpOperation oper,
GenObject context 
)
virtual

Try to evaluate a single function

Parameters
stackEvaluation stack in use, parameters are popped off this stack and results are pushed back on stack
operFunction to evaluate
contextPointer to arbitrary object passed from evaluation methods
Returns
True if evaluation succeeded

Reimplemented in ScriptContext, and JsObject.


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