A derivable class to hold compiled script images for active processes.
More...
#include <script3.h>
Inheritance diagram for ost::ScriptImage:
Collaboration diagram for ost::ScriptImage:
Data Structures
Public Types
enum
symType {
symNORMAL = 0,
symCONST,
symDYNAMIC,
symFIFO,
symSEQUENCE,
symSTACK,
symCOUNTER,
symPOINTER,
symREF,
symARRAY,
symASSOC,
symINITIAL,
symNUMBER,
symLOCK,
symPROPERTY,
symORIGINAL,
symMODIFIED,
symTIMER,
symBOOL
}
typedef bool(ScriptInterp::*
Method )(void)
typedef long(*
Function )(long *args, unsigned prec)
typedef void(*
Init )(void)
Public Member Functions
Get memory for assoc data...
More...
Get current entity being compiled...
More...
Add a select record to the currently compiled script.
More...
Add a registration record to the compiled script.
More...
Get a registration record to use.
More...
Add an advertised route in a priority slot.
More...
Get the selection list from the image.
More...
Get the registration list from the image.
More...
Get an advertised priority record from the image.
More...
Get the session instance of the image.
More...
Construct a new working image.
More...
Purge and reload the script image workspace.
More...
Used in the derived constructor to "commit" the current image for new processes.
More...
Used by a derived constructor to load an initialization list.
More...
void
initial (const char *keyword, const char *value, unsigned size=0)
Used to load a single initialization list entry.
More...
Get the command object associated with the image.
More...
Get the ripple flag for the current image.
More...
unsigned
gather (const char *suffix,
Name **array, unsigned size)
Fetch list of relational scripts.
More...
See if the image is referenced...
More...
Get the active image from command.
More...
unsigned
getIndex (char **data, unsigned max)
Get an index array of ALL keywords that are stored by the current keydata object.
More...
void
load (const char *keypath)
Load additional key values into the currrent object from the specfied config source (a config file/section pair).
More...
Load default keywords into the current object.
More...
void
loadPrefix (const char *prefix, const char *keypath)
Load additional key values into the currrent object from the specfied config source (a config file/section pair).
More...
void
loadFile (const char *filepath, const char *
keys=NULL, const char *pre=NULL)
Load additional keys into the current object using a real filename that is directly passed rather than a computed key path.
More...
Unlink the keydata object from the cache file stream.
More...
Get a count of the number of data "values" that is associated with a specific keyword.
More...
Get the count of keyword indexes that are actually available so one can allocate a table to receive getIndex.
More...
Get the first data value for a given keyword.
More...
const char *
getLast (const char *sym)
Get the last (most recently set) value for a given keyword.
More...
bool
isKey (const char *sym)
Find if a given key exists.
More...
const char *
getString (const char *sym, const char *def=NULL)
Get a string value, with an optional default if missing.
More...
long
getLong (const char *sym, long def=0)
Get a long value, with an optional default if missing.
More...
double
getDouble (const char *key, double def=0.)
void
setValue (const char *sym, const char *data)
Set (replace) the value of a given keyword.
More...
const char *const *
getList (const char *sym)
Return a list of all values set for the given keyword returned in order.
More...
Clear all values associated with a given keyword.
More...
A convient notation for accessing the keydata as an associative array of keyword/value pairs through the [] operator.
More...
Static Public Member Functions
static member to end keydata i/o allocations.
More...
static bool
use (const char *name)
static unsigned
getIndex (const char *id)
Data Fields
Static Public Attributes
Protected Member Functions
Get the interpreter method pointer for a given keyword.
More...
virtual void *
first (size_t size)
Allocate first workspace from paged memory.
More...
Allocate a string from the memory pager pool and copy the string into it's new memory area.
More...
virtual void *
alloc (size_t size)
Allocate memory from either the currently active page, or allocate a new page for the object.
More...
char *
alloc (const char *str)
Allocate a string from the memory pager pool and copy the string inti it's new memory area.
More...
Clean for memory cleanup before exiting.
More...
Return the total number of pages that have been allocated for this memory pool.
More...
Protected Attributes
Static Protected Attributes
Friends
Detailed Description
A derivable class to hold compiled script images for active processes.
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.nosp@m.@ost.nosp@m.el.co.nosp@m.m. Script compiler image set.
Definition at line 914 of file script3.h.
Member Typedef Documentation
typedef const char*(ScriptCommand::* ost::Script::Check)(
Line *line,
ScriptImage *img)
inherited |
typedef bool(* ost::Script::Cond)(
ScriptInterp *interp, const char *v)
inherited |
typedef long(* ost::Script::Function)(long *args, unsigned prec)
inherited |
typedef void(* ost::Script::Init)(void)
inherited |
typedef const char*(* ost::Script::Meta)(
ScriptInterp *interp, const char *token)
inherited |
typedef bool(ScriptInterp::* ost::Script::Method)(void)
inherited |
typedef const char*(* ost::Script::Parse)(
ScriptCompiler *img, const char *token)
inherited |
Member Enumeration Documentation
Enumerator |
---|
scrPUBLIC |
scrPROTECTED |
scrPRIVATE |
scrFUNCTION |
scrLOCAL |
Definition at line 113 of file script3.h.
Enumerator |
---|
symNORMAL |
symCONST |
symDYNAMIC |
symFIFO |
symSEQUENCE |
symSTACK |
symCOUNTER |
symPOINTER |
symREF |
symARRAY |
symASSOC |
symINITIAL |
symNUMBER |
symLOCK |
symPROPERTY |
symORIGINAL |
symMODIFIED |
symTIMER |
symBOOL |
Definition at line 123 of file script3.h.
Constructor & Destructor Documentation
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
static void ost::Script::addConditional
(
const char *
name,
)
staticinherited |
static void ost::Script::addFunction
(
const char *
name,
unsigned
count,
)
staticinherited |
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.
virtual void* MemPager::alloc
(
size_t
size )
protectedvirtualinherited |
Allocate memory from either the currently active page, or allocate a new page for the object.
- Parameters
-
size size of memory to allocate.
- Returns
- pointer to allocated memory.
Reimplemented in SharedMemPager.
char* MemPager::alloc
(
const char *
str )
protectedinherited |
Allocate a string from the memory pager pool and copy the string inti it's new memory area.
This checks only the last active page for available space before allocating a new page.
- Parameters
-
str string to allocate and copy into paged memory pool.
- Returns
- copy of string from allocated memory.
static bool ost::Script::append
(
Symbol *
sym,
const char *
value
)
staticinherited |
void MemPager::clean
(
void
)
protectedinherited |
Clean for memory cleanup before exiting.
static void ost::Script::clear
(
Symbol *
sym )
staticinherited |
void Assoc::clear
(
void
)
protectedinherited |
void Keydata::clrValue
(
const char *
sym )
inherited |
Clear all values associated with a given keyword.
This does not de-allocate the keyword from memory, however.
- Returns
- keyword name to clear.
static bool ost::Script::commit
(
Symbol *
sym,
const char *
value
)
staticinherited |
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.
static unsigned ost::Script::count
(
Symbol *
sym )
staticinherited |
void ost::ScriptImage::decRef
(
void
)
inline |
dec the reference count.
Definition at line 1121 of file script3.h.
const char* ost::ScriptImage::dupString
(
const char *
str )
Duplicate string...
- Returns
- memory pointer.
- Parameters
-
string requested.
static void Keydata::end
(
void
)
staticinherited |
static member to end keydata i/o allocations.
static const char* ost::Script::extract
(
Symbol *
sym )
staticinherited |
virtual void ost::ScriptImage::fastBranch
(
ScriptInterp *
interp )
virtual |
virtual void* MemPager::first
(
size_t
size )
protectedvirtualinherited |
Allocate first workspace from paged memory.
This method scans all currently allocated blocks for available space before adding new pages and hence is both slower and more efficient.
- Parameters
-
size size of memory to allocate.
- Returns
- pointer to allocated memory.
Reimplemented in SharedMemPager.
char* MemPager::first
(
char *
str )
protectedinherited |
Allocate a string from the memory pager pool and copy the string into it's new memory area.
This method allocates memory by first searching for an available page, and then allocating a new page if no space is found.
- Parameters
-
str string to allocate and copy into paged memory pool.
- Returns
- copy of string from allocated memory.
unsigned ost::ScriptImage::gather
(
const char *
suffix,
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.
Get the active image from command.
Useful when compiling.
- Returns
- ScriptImage of currently active image.
Definition at line 1137 of file script3.h.
bool Keydata::getBool
(
const char *
key )
inherited |
Get a bool value.
- Parameters
-
sym keyword name.
- Returns
- true or false.
Get the command object associated with the image.
- Returns
- command object.
Definition at line 1091 of file script3.h.
int Keydata::getCount
(
const char *
sym )
inherited |
Get a count of the number of data "values" that is associated with a specific keyword.
Each value is from an accumulation of "<code>load()</code>" requests.
- Parameters
-
sym keyword symbol name.
- Returns
- count of values associated with keyword.
unsigned Keydata::getCount
(
void
)
inherited |
Get the count of keyword indexes that are actually available so one can allocate a table to receive getIndex.
- Returns
- number of keywords found.
Name* ost::ScriptImage::getCurrent
(
void
)
inline |
Get current entity being compiled...
- Returns
- pointer to script currently compiling.
Definition at line 973 of file script3.h.
double Keydata::getDouble
(
const char *
key,
double
def = 0.
)
inherited |
Get a floating value.
- Parameters
-
sym keyword name.
default if not set.
- Returns
- value of key.
const char* Keydata::getFirst
(
const char *
sym )
inherited |
Get the first data value for a given keyword.
This will typically be the /etc
set global default.
- Parameters
-
sym keyword symbol name.
- Returns
- first set value for this symbol.
Method ost::ScriptImage::getHandler
(
const char *
keyword )
inlineprotected |
Get the interpreter method pointer for a given keyword.
- Returns
- method handler.
- Parameters
-
keyword to search.
Definition at line 943 of file script3.h.
static unsigned ost::Script::getIndex
(
const char *
id )
staticinherited |
unsigned Keydata::getIndex
(
char **
data,
unsigned
max
)
inherited |
Get an index array of ALL keywords that are stored by the current keydata object.
- Returns
- number of keywords found.
- Parameters
-
data pointer of array to hold keyword strings.
max number of entries the array can hold.
unsigned long ost::ScriptImage::getInstance
(
void
)
inline |
Get the session instance of the image.
Definition at line 1032 of file script3.h.
const char* Keydata::getLast
(
const char *
sym )
inherited |
Get the last (most recently set) value for a given keyword.
This is typically the value actually used.
- Parameters
-
sym keyword symbol name.
- Returns
- last set value for this symbol.
const char* const* Keydata::getList
(
const char *
sym )
inherited |
Return a list of all values set for the given keyword returned in order.
- Returns
- list pointer of array holding all keyword values.
- Parameters
-
sym keyword name to fetch.
long Keydata::getLong
(
const char *
sym,
long
def = 0
)
inherited |
Get a long value, with an optional default if missing.
- Parameters
-
sym keyword name.
default if not present.
- Returns
- long value of key.
void* ost::ScriptImage::getMemory
(
size_t
size )
virtual |
Get memory for assoc data...
- Returns
- memory pointer.
- Parameters
-
size of memory request.
Implements Assoc.
int MemPager::getPages
(
void
)
inlineinherited |
Return the total number of pages that have been allocated for this memory pool.
- Returns
- number of pages allocated.
Definition at line 181 of file misc.h.
void* Assoc::getPointer
(
const char *
id )
const
inherited |
Line* ost::ScriptImage::getRegistration
(
void
)
inline |
Get the registration list from the image.
- Returns
- registration list.
Definition at line 1018 of file script3.h.
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.
Definition at line 1026 of file script3.h.
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.
Definition at line 1010 of file script3.h.
const char* Keydata::getString
(
const char *
sym,
const char *
def = NULL
)
inherited |
Get a string value, with an optional default if missing.
- Parameters
-
sym keyword name.
default if not present.
- Returns
- string value of key.
Keysym* Keydata::getSymbol
(
const char *
sym,
bool
create
)
protectedinherited |
void ost::ScriptImage::incRef
(
void
)
inline |
inc the reference count.
Definition at line 1115 of file script3.h.
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.
static bool ost::Script::isFunction
(
Name *
scr )
staticinherited |
bool Keydata::isKey
(
const char *
sym )
inherited |
Find if a given key exists.
- Parameters
-
sym keyword to find.
- Returns
- true if exists.
static bool ost::Script::isPrivate
(
Name *
scr )
staticinherited |
bool ost::ScriptImage::isRef
(
void
)
inline |
See if the image is referenced...
- Returns
- true if is referenced.
Definition at line 1129 of file script3.h.
bool ost::ScriptImage::isRipple
(
void
)
inline |
Get the ripple flag for the current image.
- Returns
- true if a ripple image.
Definition at line 1099 of file script3.h.
static bool ost::Script::isScript
(
Name *
scr )
staticinherited |
static bool ost::Script::isSymbol
(
const char *
id )
staticinherited |
void Keydata::load
(
const char *
keypath )
inherited |
Load additional key values into the currrent object from the specfied config source (a config file/section pair).
These values will overlay the current keywords when matches are found. This can be used typically in a derived config object class constructor to first load a /etc
section, and then load a matching user specific entry from ~/.
to override default system values with user specific keyword values.
- Parameters
-
keypath (filepath/section)
void Keydata::load
(
Define *
pairs )
inherited |
Load default keywords into the current object.
This only loads keyword entries which have not already been defined to reduce memory usage. This form of Load is also commonly used in the constructor of a derived Keydata class.
- Parameters
-
pairs list of NULL terminated default keyword/value pairs.
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 Keydata::loadFile
(
const char *
filepath,
const char *
keys = NULL
,
const char *
pre = NULL
)
inherited |
Load additional keys into the current object using a real filename that is directly passed rather than a computed key path.
This also uses a [keys] section as passed to the object.
- Parameters
-
filepath to load from
keys section to parse from, or NULL to parse from head
pre optional key prefix
void Keydata::loadPrefix
(
const char *
prefix,
const char *
keypath
)
inherited |
Load additional key values into the currrent object from the specfied config source (a config file/section pair).
These values will overlay the current keywords when matches are found. This can be used typically in a derived config object class constructor to first load a /etc
section, and then load a matching user specific entry from ~/.
to override default system values with user specific keyword values. This varient puts a prefix in front of the key name.
- Parameters
-
prefix
keypath (filepath/section)
const char* Keydata::operator[]
(
const char *
keyword )
inlineinherited |
A convient notation for accessing the keydata as an associative array of keyword/value pairs through the [] operator.
Definition at line 611 of file misc.h.
void ost::ScriptImage::purge
(
void
)
Purge and reload the script image workspace.
void Assoc::setPointer
(
const char *
id,
void *
data
)
inherited |
void Keydata::setValue
(
const char *
sym,
const char *
data
)
inherited |
Set (replace) the value of a given keyword.
This new value will become the value returned from getLast(), while the prior value will still be stored and found from getList()
.
- Parameters
-
sym keyword name to set.
data string to store for the keyword.
static unsigned ost::Script::storage
(
Symbol *
sym )
staticinherited |
static bool ost::Script::symindex
(
Symbol *
sym,
short
offset
)
staticinherited |
void Keydata::unlink
(
void
)
inherited |
Unlink the keydata object from the cache file stream.
This should be used if you plan to keepa Keydata object after it is loaded once all keydata objects have been loaded, otherwise the cfgFile stream will remain open. You can also use endKeydata().
static bool ost::Script::use
(
const char *
name )
staticinherited |
Friends And Related Function Documentation
Field Documentation
const char* ost::Script::access_host
staticinherited |
const char* ost::Script::access_pass
staticinherited |
const char* ost::Script::access_user
staticinherited |
Line* ost::ScriptImage::advertising[16]
protected |
const char* ost::Script::altplugins
staticinherited |
const char* ost::Script::apps_extensions
staticinherited |
const char* ost::Script::apps_prefix
staticinherited |
unsigned ost::Script::autoStepping
staticinherited |
Name * ost::ScriptImage::current
protected |
char ost::Script::decimal
staticinherited |
Mutex ost::ScriptImage::duplock
protected |
const char* ost::Script::etc_prefix
staticinherited |
const char* ost::Script::exec_extensions
staticinherited |
bool ost::Script::exec_funcs
staticinherited |
const char* ost::Script::exec_prefix
staticinherited |
const char* ost::Script::exec_token
staticinherited |
const char* ost::Script::exit_token
staticinherited |
bool ost::Script::fastStart
staticinherited |
unsigned ost::Script::fastStepping
staticinherited |
unsigned long ost::ScriptImage::instance
protected |
const char* ost::Script::log_prefix
staticinherited |
size_t ost::Script::pagesize
staticinherited |
const char* ost::Script::plugins
staticinherited |
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
staticprotected |
unsigned ost::Script::symlimit
staticinherited |
unsigned ost::Script::symsize
staticinherited |
bool ost::Script::use_definitions
staticinherited |
bool ost::Script::use_funcs
staticinherited |
bool ost::Script::use_macros
staticinherited |
bool ost::Script::use_merge
staticinherited |
bool ost::Script::use_prefix
staticinherited |
bool ost::Script::useBigmem
staticinherited |
const char* ost::Script::var_prefix
staticinherited |
The documentation for this class was generated from the following file:
Generated on Dec 21, 2017 for
commoncpp2-1.8.1,
ccrtp-1.7.2,
libzrtpcpp-2.3.4,
ccscript3-1.1.7,
ccaudio2-1.0.0 and
bayonne2-2.3.2
(after installation in /usr/local/)
by
doxygen 1.8.6