Google

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

ScriptSymbol Class Reference

This class manages symbol tables for the scripting engine. Symbol table management for scripting engine. More...

#include <script.h>

Inheritance diagram for ScriptSymbol:

SharedMemPager ScriptInterp List of all members.

Public Methods

 ScriptSymbol (int size, int pgsize = 1024)
char* getSymbol (const char *symbol)
 Fetch the address of the value of a given symbol identifier. More...

char* setSymbol (const char *symbol, const char *value = "")
 Set a given symbol to a new value. More...

char* setConst (const char *symbol, const char *value = "")
 Set a constant value. More...

char* setSymbol (const char *symbol, int size = 0)
 Create a new symbol entry of a specified size. More...

void clrSymbol (const char *id)
 Clear a symbol definition. More...

void Purge (void)
 Purge user defined symbols and memory space.


Protected Methods

virtual scriptsymbol_tgetEntry (const char *symbol, int size = 0)
 Fetch a symbol entry. More...

virtual void Commit (scriptsymbol_t *sym)
 A virtual method used when "committing" symbol changes. More...

int getSymbolSize (void)
 Fetch default symbol size. More...


Detailed Description

This class manages symbol tables for the scripting engine. Symbol table management for 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.

Author(s):
David Sugar <dyfet@ostel.com>


Constructor & Destructor Documentation

ScriptSymbol::ScriptSymbol ( int size,
int pgsize = 1024 )
 


Member Function Documentation

void ScriptSymbol::Commit ( scriptsymbol_t * sym ) [inline, 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:
symbol   to commit.

void ScriptSymbol::Purge ( void )
 

Purge user defined symbols and memory space.

void ScriptSymbol::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:
symbol   name to clear.

scriptsymbol_t * ScriptSymbol::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".

Returns:
symbol entry or NULL if not found.
Parameters:
symbol   name to find or create.
size   of symbol space to create if not found.

char * ScriptSymbol::getSymbol ( const char * symbol )
 

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

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

int ScriptSymbol::getSymbolSize ( void ) [inline, protected]
 

Fetch default symbol size.

Returns:
default symbol size.

char * ScriptSymbol::setConst ( const char * symbol,
const char * value = "" )
 

Set a constant value.

Parameters:
symbol   name to find.
value   string to set.
Returns:
NULL if not found, else value.

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

Create a new symbol entry of a specified size.

Parameters:
symbol   name to create.
size   of symbol, otherwise default size used.
buffer   or NULL if exists.

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

Set a given symbol to a new value.

Parameters:
symbol   name to find.
value   string to set.
Returns:
NULL if not found, else value.


The documentation for this class was generated from the following file:
Generated at Thu Apr 5 14:11:40 2001 for ccscript by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000