Loading...
Searching...
No Matches
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:
[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.
virtual | ~CBotExternalCallClass ()
| Destructor.
virtual CBotTypResult | Compile (CBotVar *thisVar, CBotVar *args, void *user) override
| Compile the function.
virtual bool | Run (CBotVar *thisVar, CBotStack *pStack) override
| Execute the function.
Public Member Functions inherited from CBot::CBotExternalCall
| CBotExternalCall ()
| Constructor.
virtual | ~CBotExternalCall ()
| Destructor.

## 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

  rExec | Runtime function
  rCompile | Compilation 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 )

override virtual

Compile the function.

Parameters

  thisVar | "this" variable for class calls, nullptr for normal calls
  args | Arguments (only types!) passed to the function
  user | User pointer provided to CBotProgram::Compile()

Implements CBot::CBotExternalCall.

## Run()

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

override virtual

Execute the function.

Parameters

  thisVar | "this" variable for class calls, nullptr for normal calls
  pStack | Stack 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:

- src/CBot/CBotExternalCall.h
- src/CBot/CBotExternalCall.cpp