ost::ScriptImage Class Reference

A derivable class to hold compiled script images for active processes.Script compiler image set. More...

#include <script3.h>

Inheritance diagram for ost::ScriptImage:

ost::Keydata ost::Script ost::Assoc ost::MemPager ost::ScriptCompiler List of all members.

Public Member Functions

void * getMemory (size_t size)
 Get memory for assoc data.
virtual void fastBranch (ScriptInterp *interp)
 Fast branch linkback code.
Name * getCurrent (void)
 Get current entity being compiled.
void addSelect (Line *line)
 Add a select record to the currently compiled script.
void addRegistration (Line *line)
 Add a registration record to the compiled script.
ScriptRegistrygetRegistry (void)
 Get a registration record to use.
void addRoute (Line *line, unsigned pri)
 Add an advertised route in a priority slot.
Line * getSelect (void)
 Get the selection list from the image.
Line * getRegistration (void)
 Get the registration list from the image.
Line * getRoute (unsigned pri)
 Get an advertised priority record from the image.
unsigned long getInstance (void)
 Get the session instance of the image.
 ScriptImage (ScriptCommand *cmdset, const char *symset)
 Construct a new working image.
 ~ScriptImage ()
 Destruct the ScriptImage itself by removing linked objects.
void purge (void)
 Purge and reload the script image workspace.
void commit (void)
 Used in the derived constructor to "commit" the current image for new processes.
void load (Initial *ilist)
 Used by a derived constructor to load an initialization list.
void initial (const char *keyword, const char *value, unsigned size=0)
 Used to load a single initialization list entry.
virtual Name * getScript (const char *name)
 Fetch named script.
ScriptCommandgetCommand (void)
 Get the command object associated with the image.
bool isRipple (void)
 Get the ripple flag for the current image.
unsigned gather (const char *suffix, Name **array, unsigned size)
 Fetch list of relational scripts.
void incRef (void)
 inc the reference count.
void decRef (void)
 dec the reference count.
bool isRef (void)
 See if the image is referenced.
ScriptImagegetActive (void)
 Get the active image from command.

Protected Member Functions

Method getHandler (const char *keyword)
 Get the interpreter method pointer for a given keyword.

Protected Attributes

ScriptCommandcmds
unsigned refcount
Name * index [SCRIPT_INDEX_SIZE+1]
Name * current
Line * select
Line * selecting
Line * registration
Line * advertising [SCRIPT_ROUTE_SLOTS]
Mutex duplock
ScriptObjectobjects
unsigned long instance
ost::ScriptImage::InitialListilist

Static Protected Attributes

static unsigned long serial

Friends

class ScriptObject
class ScriptInterp

Classes

class  InitialList

Detailed Description

A derivable class to hold compiled script images for active processes.Script compiler image set.

This includes the script image compiler itself. Typically, a script is compiled one file at a time from a directory, and the committed, during the constructor in a derived class.

Author:
David Sugar <dyfet@ostel.com>.


Constructor & Destructor Documentation

ost::ScriptImage::ScriptImage ScriptCommand cmdset,
const char *  symset
 

Construct a new working image.

This must be derived to an application specific compiler that can scan directories and invoke the compiler as needed.

Parameters:
cmdset of keyword table object used.
symset of predefined symbols being used.

ost::ScriptImage::~ScriptImage  ) 
 

Destruct the ScriptImage itself by removing linked objects.


Member Function Documentation

void ost::ScriptImage::addRegistration Line *  line  ) 
 

Add a registration record to the compiled script.

Parameters:
line statement to add to list.

void ost::ScriptImage::addRoute Line *  line,
unsigned  pri
 

Add an advertised route in a priority slot.

Parameters:
line statement to add to list.
pri of route to add to.

void ost::ScriptImage::addSelect Line *  line  ) 
 

Add a select record to the currently compiled script.

Parameters:
line statement to add to list.

void ost::ScriptImage::commit void   ) 
 

Used in the derived constructor to "commit" the current image for new processes.

This is usually the last statement in the derived constructor.

Reimplemented in ost::ScriptCompiler.

void ost::ScriptImage::decRef void   )  [inline]
 

dec the reference count.

virtual void ost::ScriptImage::fastBranch ScriptInterp interp  )  [virtual]
 

Fast branch linkback code.

Reimplemented in ost::ScriptCompiler.

unsigned ost::ScriptImage::gather const char *  suffix,
Name **  array,
unsigned  size
 

Fetch list of relational scripts.

Parameters:
suffix extension of scripts being fetched.
array of script objects gathered from image.
size limit of array to gather.
Returns:
count of entries found.

ScriptImage* ost::ScriptImage::getActive void   )  [inline]
 

Get the active image from command.

Useful when compiling.

Returns:
ScriptImage of currently active image.

ScriptCommand* ost::ScriptImage::getCommand void   )  [inline]
 

Get the command object associated with the image.

Returns:
command object.

Name* ost::ScriptImage::getCurrent void   )  [inline]
 

Get current entity being compiled.

..

Returns:
pointer to script currently compiling.

Method ost::ScriptImage::getHandler const char *  keyword  )  [inline, protected]
 

Get the interpreter method pointer for a given keyword.

Returns:
method handler.
Parameters:
keyword to search.

unsigned long ost::ScriptImage::getInstance void   )  [inline]
 

Get the session instance of the image.

void* ost::ScriptImage::getMemory size_t  size  )  [virtual]
 

Get memory for assoc data.

..

Returns:
memory pointer.
Parameters:
size of memory request.

Implements ost::Assoc.

Line* ost::ScriptImage::getRegistration void   )  [inline]
 

Get the registration list from the image.

Returns:
registration list.

ScriptRegistry* ost::ScriptImage::getRegistry void   ) 
 

Get a registration record to use.

Returns:
registration object.

Line* ost::ScriptImage::getRoute unsigned  pri  )  [inline]
 

Get an advertised priority record from the image.

Returns:
priority list.

virtual Name* ost::ScriptImage::getScript const char *  name  )  [virtual]
 

Fetch named script.

Parameters:
name of script to find.
Returns:
script or NULL.

Line* ost::ScriptImage::getSelect void   )  [inline]
 

Get the selection list from the image.

Returns:
selection list.

void ost::ScriptImage::incRef void   )  [inline]
 

inc the reference count.

void ost::ScriptImage::initial const char *  keyword,
const char *  value,
unsigned  size = 0
 

Used to load a single initialization list entry.

Parameters:
keyword name to initialize.
value of keyword.
size of keyword data field.

bool ost::ScriptImage::isRef void   )  [inline]
 

See if the image is referenced.

..

Returns:
true if is referenced.

bool ost::ScriptImage::isRipple void   )  [inline]
 

Get the ripple flag for the current image.

Returns:
true if a ripple image.

void ost::ScriptImage::load Initial *  ilist  ) 
 

Used by a derived constructor to load an initialization list.

Parameters:
ilist initialization list of symbol pairs to load.

void ost::ScriptImage::purge void   ) 
 

Purge and reload the script image workspace.

Reimplemented from ost::MemPager.


Friends And Related Function Documentation

friend class ScriptInterp [friend]
 

Reimplemented in ost::ScriptCompiler.

friend class ScriptObject [friend]
 


Member Data Documentation

Line* ost::ScriptImage::advertising[SCRIPT_ROUTE_SLOTS] [protected]
 

ScriptCommand* ost::ScriptImage::cmds [protected]
 

Name * ost::ScriptImage::current [protected]
 

Mutex ost::ScriptImage::duplock [protected]
 

ost::ScriptImage::InitialList * ost::ScriptImage::ilist [protected]
 

Name* ost::ScriptImage::index[SCRIPT_INDEX_SIZE+1] [protected]
 

unsigned long ost::ScriptImage::instance [protected]
 

ScriptObject* ost::ScriptImage::objects [protected]
 

unsigned ost::ScriptImage::refcount [protected]
 

Line * ost::ScriptImage::registration [protected]
 

Line* ost::ScriptImage::select [protected]
 

Line * ost::ScriptImage::selecting [protected]
 

unsigned long ost::ScriptImage::serial [static, protected]
 


The documentation for this class was generated from the following file:
Generated on Thu Apr 6 09:03:07 2006 for Bayonne Framework by  doxygen 1.4.6