Colobot
Public Types | Public Member Functions | List of all members
CBot::CBotExternalCallClass Class Reference

Implementation of CBot external call for class methods, using compilation and runtime functions. More...

#include <src/CBot/CBotExternalCall.h>

Inheritance diagram for CBot::CBotExternalCallClass:
Inheritance graph
[legend]

Public Types

typedef bool(* RuntimeFunc) (CBotVar *pThis, CBotVar *pVar, CBotVar *pResult, int &Exception, void *user)
 
typedef CBotTypResult(* CompileFunc) (CBotVar *pThis, CBotVar *&pVar)
 

Public Member Functions

 CBotExternalCallClass (RuntimeFunc rExec, CompileFunc rCompile)
 Constructor. More...
 
virtual ~CBotExternalCallClass ()
 Destructor. More...
 
virtual CBotTypResult Compile (CBotVar *thisVar, CBotVar *args, void *user) override
 Compile the function. More...
 
virtual bool Run (CBotVar *thisVar, CBotStack *pStack) override
 Execute the function. More...
 
- Public Member Functions inherited from CBot::CBotExternalCall
 CBotExternalCall ()
 Constructor. More...
 
virtual ~CBotExternalCall ()
 Destructor. More...
 
virtual CBotTypResult Compile (CBotVar *thisVar, CBotVar *args, void *user)=0
 Compile the function. More...
 
virtual bool Run (CBotVar *thisVar, CBotStack *pStack)=0
 Execute the function. More...
 

Detailed Description

Implementation of CBot external call for class methods, using compilation and runtime functions.

Constructor & Destructor Documentation

◆ CBotExternalCallClass()

CBot::CBotExternalCallClass::CBotExternalCallClass ( RuntimeFunc  rExec,
CompileFunc  rCompile 
)

Constructor.

Parameters
rExecRuntime function
rCompileCompilation function
See also
CBotProgram::AddFunction()

◆ ~CBotExternalCallClass()

CBot::CBotExternalCallClass::~CBotExternalCallClass ( )
virtual

Destructor.

Member Function Documentation

◆ Compile()

CBotTypResult CBot::CBotExternalCallClass::Compile ( CBotVar thisVar,
CBotVar args,
void *  user 
)
overridevirtual

Compile the function.

Parameters
thisVar"this" variable for class calls, nullptr for normal calls
argsArguments (only types!) passed to the function
userUser pointer provided to CBotProgram::Compile()

Implements CBot::CBotExternalCall.

◆ Run()

bool CBot::CBotExternalCallClass::Run ( CBotVar thisVar,
CBotStack pStack 
)
overridevirtual

Execute the function.

Parameters
thisVar"this" variable for class calls, nullptr for normal calls
pStackStack to execute the function on
Returns
false to request program interruption, true otherwise

Implements CBot::CBotExternalCall.


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