#include <script.h>
Inheritance diagram for ScriptSymbol:
Public Member Functions | |
virtual Symbol * | getEntry (const char *symbol, int size=0) |
Fetch a symbol entry. | |
void | setExclusive (bool enable) |
Can be used to tie together an exclusive function. | |
virtual void | commit (Symbol *sym) |
A virtual method used when "committing" symbol changes. | |
Symbol * | getTrigger (void) |
Fetch a pending trigger value and clear it. | |
int | getSymbolSize (void) |
Fetch default symbol size. | |
ScriptSymbol (int size, int pgsize=1024) | |
~ScriptSymbol () | |
void * | getPointer (const char *symbol) |
Fetch an embedded pointer held in a symbol identifier. | |
bool | setPointer (const char *symbol, void *data) |
Set an embedded pointer object as a symbol. | |
char * | getSymbol (const char *symbol) |
Fetch the address of the value of a given symbol identifier. | |
char * | setSymbol (const char *symbol, const char *value="") |
Set a given symbol to a new value. | |
char * | setConst (const char *symbol, const char *value="") |
Set a constant value. | |
bool | makeSequence (const char *id, unsigned char count, unsigned char recsize) |
Create a sequence object (looping fifo). | |
bool | makeCache (const char *id, unsigned char count, unsigned char recsize) |
bool | makeStack (const char *id, unsigned char count, unsigned char recsize) |
Create a stack object. | |
bool | makeFifo (const char *id, unsigned char count, unsigned char recsize) |
Create a fifo object. | |
bool | makeCounter (const char *id) |
Create an automatic counter object. | |
bool | postSymbol (Symbol *sym, const char *value) |
Post data into a fifo. | |
bool | removeSymbol (Symbol *sym, const char *value) |
Remove entry from a queue. | |
char * | readSymbol (Symbol *sym) |
Read symbol handles special symbol types. | |
bool | setAlias (const char *symbol, const char *source) |
Set an alias. | |
bool | swapSymbol (const char *oldname, const char *newname) |
Swap an existing symbol, relinks table sets. | |
Symbol * | getAlias (const char *symbol) |
Get an alias. | |
char * | setSymbol (const char *symbol, int size=0) |
Create a new symbol entry of a specified size. | |
void | clrSymbol (const char *id) |
Clear a symbol definition. | |
void | purge (void) |
Purge user defined symbols and memory space. | |
unsigned | gather (Symbol **index, unsigned max, const char *prefrix, const char *suffix="") |
Gather a listing of common script symbols. | |
Protected Member Functions | |
bool | setArray (const char *sym, const char *source) |
Friends | |
class | ScriptInterp |
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::ScriptSymbol | ( | int | size, | |
int | pgsize = 1024 | |||
) |
ScriptSymbol::~ScriptSymbol | ( | ) |
bool ScriptSymbol::setArray | ( | const char * | sym, | |
const char * | source | |||
) | [protected] |
virtual Symbol* ScriptSymbol::getEntry | ( | const char * | symbol, | |
int | size = 0 | |||
) | [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".
symbol | name to find or create. | |
size | of symbol space to create if not found. |
void ScriptSymbol::setExclusive | ( | bool | enable | ) |
virtual void ScriptSymbol::commit | ( | Symbol * | sym | ) | [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.
symbol | to commit. |
Symbol* ScriptSymbol::getTrigger | ( | void | ) |
Fetch a pending trigger value and clear it.
int ScriptSymbol::getSymbolSize | ( | void | ) | [inline] |
Fetch default symbol size.
void* ScriptSymbol::getPointer | ( | const char * | symbol | ) |
Fetch an embedded pointer held in a symbol identifier.
symbol | name. |
bool ScriptSymbol::setPointer | ( | const char * | symbol, | |
void * | data | |||
) |
Set an embedded pointer object as a symbol.
symbol | name. | |
data | pointer to save. |
char* ScriptSymbol::getSymbol | ( | const char * | symbol | ) |
Fetch the address of the value of a given symbol identifier.
symbol | name. |
char* ScriptSymbol::setSymbol | ( | const char * | symbol, | |
const char * | value = "" | |||
) |
Set a given symbol to a new value.
symbol | name to find. | |
value | string to set. |
char* ScriptSymbol::setConst | ( | const char * | symbol, | |
const char * | value = "" | |||
) |
Set a constant value.
symbol | name to find. | |
value | string to set. |
bool ScriptSymbol::makeSequence | ( | const char * | id, | |
unsigned char | count, | |||
unsigned char | recsize | |||
) |
Create a sequence object (looping fifo).
name | of sequence. | |
max. | number of sequences. | |
size | of sequence data record. |
bool ScriptSymbol::makeCache | ( | const char * | id, | |
unsigned char | count, | |||
unsigned char | recsize | |||
) |
bool ScriptSymbol::makeStack | ( | const char * | id, | |
unsigned char | count, | |||
unsigned char | recsize | |||
) |
Create a stack object.
name | of stack. | |
number | of entries. | |
size | of record. |
bool ScriptSymbol::makeFifo | ( | const char * | id, | |
unsigned char | count, | |||
unsigned char | recsize | |||
) |
Create a fifo object.
name | of fifo. | |
number | of records. | |
size | of record. |
bool ScriptSymbol::makeCounter | ( | const char * | id | ) |
Create an automatic counter object.
name | of counter. |
bool ScriptSymbol::postSymbol | ( | Symbol * | sym, | |
const char * | value | |||
) |
Post data into a fifo.
symbol | object to post. | |
data | value to post. |
bool ScriptSymbol::removeSymbol | ( | Symbol * | sym, | |
const char * | value | |||
) |
Remove entry from a queue.
symbol | object to remove from. | |
data | value to find and remove. |
char* ScriptSymbol::readSymbol | ( | Symbol * | sym | ) |
Read symbol handles special symbol types.
symbol. |
bool ScriptSymbol::setAlias | ( | const char * | symbol, | |
const char * | source | |||
) |
Set an alias.
symbol | name to alias. | |
value | of alias to set. |
bool ScriptSymbol::swapSymbol | ( | const char * | oldname, | |
const char * | newname | |||
) |
Swap an existing symbol, relinks table sets.
symbol | name to find. | |
symbol | name to swap with. |
Symbol* ScriptSymbol::getAlias | ( | const char * | symbol | ) |
Get an alias.
symbol | name to find. |
char* ScriptSymbol::setSymbol | ( | const char * | symbol, | |
int | size = 0 | |||
) |
Create a new symbol entry of a specified size.
symbol | name to create. | |
size | of symbol, otherwise default size used. | |
buffer | or NULL if exists. |
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.
symbol | name to clear. |
void ScriptSymbol::purge | ( | void | ) |
Purge user defined symbols and memory space.
unsigned ScriptSymbol::gather | ( | Symbol ** | index, | |
unsigned | max, | |||
const char * | prefrix, | |||
const char * | suffix = "" | |||
) |
Gather a listing of common script symbols.
friend class ScriptInterp [friend] |