Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

CScope.cpp File Reference

Contains the implementation of the CScope class, as well as functions relating to scopes. More...

#include "CentumSharedCode.h"
#include <stdio.h>

Include dependency graph for CScope.cpp:


Functions

CENTUMSHAREDCODE_API void AddCScopeReference (CScope *scope)
 This function increases the reference count of the scope by one.
CENTUMSHAREDCODE_API void ReleaseCScope (CScope *scope)
 This function decreases the reference count of the scope by one.
CENTUMSHAREDCODE_API ExecutionReturn CallFunction (CScope *caller, CThing *func, CThingStack *params, CThingStack *usings)
 This function calls a rebi and returns the results of its execution.
CENTUMSHAREDCODE_API ExecutionReturn ExecuteByteCode (CScope *scope)
 This function executes the current byte code command for the scope.

Detailed Description

Contains the implementation of the CScope class, as well as functions relating to scopes.


Function Documentation

CENTUMSHAREDCODE_API void AddCScopeReference CScope scope  ) 
 

This function increases the reference count of the scope by one.

Parameters:
scope the CScope to have its reference count adjusted.

CENTUMSHAREDCODE_API ExecutionReturn CallFunction CScope caller,
CThing func,
CThingStack params,
CThingStack usings
 

This function calls a rebi and returns the results of its execution.

Passing NULL as the rebi is an error. If either the parameters to this function or the usings are NULL than an empty stack is used in their place (so passing them as NULL is safe). Then an ExecuteByteCode loop is entered until the result of the byte code execution is not EXEC_NORMAL. Finally the last non- EXEC_NORMAL return value is readied for being returned by the use of the CleanReturnValue function, and then it is returned.

Parameters:
caller the scope the rebi is being called in.
func the rebi being called
params the parameters the function is to be called with.
usings the usings the function is to be called under.
Returns:
the result of the last executed byte code, adjusted for an extra layer of return.
See also:
ExecuteByteCode()

CleanReturnValue()

CENTUMSHAREDCODE_API ExecutionReturn ExecuteByteCode CScope scope  ) 
 

This function executes the current byte code command for the scope.

If the current code position is greater than the length of the bytecode for the scope than a sub-stack is taken off the interal localstack and returned with a value of EXEC_RETURN. Otherwise the 5 bytes of the bytecode are read, the first byte being the ident.

Parameters:
scope the CScope that an instruction is being executed in.
Returns:
the result of this byte code.
See also:
bytecodes

CENTUMSHAREDCODE_API void ReleaseCScope CScope scope  ) 
 

This function decreases the reference count of the scope by one.

If the reference count of the scope reaches zero than it is destroyed and its memory is released.

Parameters:
scope the CScope to have its reference count adjusted.


Generated on Sat Apr 16 16:31:09 2005 for Centum API by  doxygen 1.4.2