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_tgetTrigger (void)
 Fetch a pending trigger value and clear it. More...

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

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

bool makeSequence (const char *id, unsigned char count, unsigned char recsize)
 Create a sequence object (looping fifo). More...

bool makeStack (const char *id, unsigned char count, unsigned char recsize)
 Create a stack object. More...

bool makeFifo (const char *id, unsigned char count, unsigned char recsize)
 Create a fifo object. More...

bool makeCounter (const char *id)
 Create an automatic counter object. More...

bool postSymbol (scriptsymbol_t *sym, const char *value)
 Post data into a fifo. More...

char* readSymbol (scriptsymbol_t *sym)
 Read symbol handles special symbol types. More...

bool setAlias (const char *symbol, const char *source)
 Set an alias. More...

scriptsymbol_tgetAlias (const char *symbol)
 Get an alias. 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...


Friends

class  ScriptInterp

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 ) [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::getAlias ( const char * symbol )
 

Get an alias.

Parameters:
symbol   name to find.
Returns:
script symbol object or NULL.

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]
 

Fetch default symbol size.

Returns:
default symbol size.

scriptsymbol_t * ScriptSymbol::getTrigger ( void )
 

Fetch a pending trigger value and clear it.

Returns:
symbol trigger that is active.

bool ScriptSymbol::makeCounter ( const char * id )
 

Create an automatic counter object.

Returns:
false if fail.
Parameters:
name   of counter.

bool ScriptSymbol::makeFifo ( const char * id,
unsigned char count,
unsigned char recsize )
 

Create a fifo object.

Returns:
false if fail.
Parameters:
name   of fifo.
number   of records.
size   of record.

bool ScriptSymbol::makeSequence ( const char * id,
unsigned char count,
unsigned char recsize )
 

Create a sequence object (looping fifo).

Returns:
false if fail.
Parameters:
name   of sequence.
max.   number of sequences.
size   of sequence data record.

bool ScriptSymbol::makeStack ( const char * id,
unsigned char count,
unsigned char recsize )
 

Create a stack object.

Returns:
false if fail.
Parameters:
name   of stack.
number   of entries.
size   of record.

bool ScriptSymbol::postSymbol ( scriptsymbol_t * sym,
const char * value )
 

Post data into a fifo.

Returns:
false if full.
Parameters:
symbol   object to post.
data   value to post.

char * ScriptSymbol::readSymbol ( scriptsymbol_t * sym )
 

Read symbol handles special symbol types.

Returns:
data of symbol.
Parameters:
symbol.  

bool ScriptSymbol::setAlias ( const char * symbol,
const char * source )
 

Set an alias.

Parameters:
symbol   name to alias.
value   of alias to set.
Returns:
bool if not set, else value.

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.


Friends And Related Function Documentation

class ScriptInterp [friend]
 


The documentation for this class was generated from the following file:
Generated at Tue Oct 9 20:52:05 2001 for ccscript by doxygen1.2.5 written by Dimitri van Heesch, © 1997-2001