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

Default implementation of CBot external call, using compilation and runtime functions. More...

#include <CBotExternalCall.h>

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

Public Types

typedef bool(* RuntimeFunc) (CBotVar *args, CBotVar *result, int &exception, void *user)
 
typedef CBotTypResult(* CompileFunc) (CBotVar *&args, void *user)
 

Public Member Functions

 CBotExternalCallDefault (RuntimeFunc rExec, CompileFunc rCompile)
 Constructor. More...
 
virtual ~CBotExternalCallDefault ()
 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...
 

Detailed Description

Default implementation of CBot external call, using compilation and runtime functions.

Constructor & Destructor Documentation

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

Constructor.

Parameters
rExecRuntime function
rCompileCompilation function
See also
CBotProgram::AddFunction()
CBot::CBotExternalCallDefault::~CBotExternalCallDefault ( )
virtual

Destructor.

Member Function Documentation

CBotTypResult CBot::CBotExternalCallDefault::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.

bool CBot::CBotExternalCallDefault::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: