class ScriptSymbol

Symbol table management for scripting engine. More...

Definition#include <../common/script.h>
InheritsSharedMemPager
Inherited byScriptInterp
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Members

Protected Members


Detailed Description

This class manages symbol tables for the scripting engine. A symbol is a variable with a reserved memory space. Some derived systems, like Bayonne IVR, may make use of a channel specific and global symbol tables.

scriptsymbol_t * getEntry (const char *symbol, int size = 0)
[protected virtual]

Fetch a symbol entry. Normally this is presumed to be from the native symbol table. However, the use of a virtual allows one to derive special "system" symbols as needed for Bayonne dialects, as well as specify special attributes and properties for system symbols. For example, in the Bayonne IVR, symbols might be used to retrieve the current DTMF digit buffer and count, but these are stored as and manipulated in a channel structure rather than in "symbol space".

Parameters:
symbolname to find or create.
sizeof symbol space to create if not found.

Returns: symbol entry or NULL if not found.

void Commit (scriptsymbol_t *sym)
[protected virtual]

A virtual method used when "committing" symbol changes. Normally this is a non-operation, but when system specific dialects are created, special symbols that must be converted from strings into other kinds of internal data types, or that might perform operations can be represented with the commit.

Parameters:
symbolto commit.

inline int getSymbolSize (void)
[protected]

Fetch default symbol size.

Returns: default symbol size.

char * getSymbol (const char *symbol)

Fetch the address of the value of a given symbol identifier.

Parameters:
symbolname.

Returns: symbol buffer address, or NULL if not found.

char * setSymbol (const char *symbol, const char *value = "")

Set a given symbol to a new value.

Parameters:
symbolname to find.
valuestring to set.

Returns: NULL if not found, else value.

char * setSymbol (const char *symbol, int size = 0)

Create a new symbol entry of a specified size.

Parameters:
symbolname to create.
sizeof symbol, otherwise default size used.
bufferor NULL if exists.

void clrSymbol (const char *id)

Clear a symbol definition. This does not remove the entry if it already exists. It mearly clears the initial flag so it still can appear undefined.

Parameters:
symbolname to clear.

void Purge (void)

Purge user defined symbols and memory space.