MFSM || scripting module

Alexandre R.J. François

Module version: 1.0
FSF code version: 0.8
ARJF © 2003-2007

contents

Description
Reference guide
Index

description

The scripting module (namespace scripting) provides shortcut functions to instantiate sources and cells, instantiate nodes and place them in source pulses, connect cells to other cells and to sources. The convention followed in the parameter order for stream connections is to plug a downstream cell into an upstream cell. The name "scripting" comes from the fact that the functions provided by this module are coding equivalents of user actions in an interactive system. In particular, the scripting module uses aspects of the MFSM implementation that are related to dynamic system evolution, such as class factories. Note that the scripting module itself does not implement any node or cell class and thus does not register any factory (there is no scripting::RegisterFactories).

reference guide

Scripting module elements are defined in the scripting namespace. This section lists all the functions defined in the Scripting module, in alphabetical order.

bool ConnectSource(fsf::CCell *pCell, fsf::CSource *pSource)

Connects cell pCell to source pSource: sets the m_pSource pointer in the cell and adds pCell to the list of cell pointers in the source. Returns true if successful, false otherwise.

bool ConnectUpstream(fsf::CCell *pCell, fsf::CCell *pUpstreamCell)

Connects cell pCell to cell pUpstream cell: sets the m_pUpstreamCell pointer to pUpstreamCell in the target upstream cell and adds pCell to the list of downstream cell pointers in the target upstream cell. Returns true if successful, false otherwise.

fsf::CCell* CreateCell(const std::string &strID)

Returns a pointer to a new instance of the specialized cell type specified by the cell type ID strID.

fsf::CNode* CreateNode(const std::string &strID, fsf::CNode *pParent=NULL)

Returns a pointer to a new instance of the specialized node type specified by the cell type ID strID. The time stamp for the node is set to the current system time. The m_pParent pointer in the newly created node instance is set to pParent. If pParent is not NULL, the new instance is added to the list of components (subnodes) of its specified parent.

template <class N> fsf::CPassiveFilter<N>* CreatePassiveFilter(const std::string &strName)

Template function, returns a pointer to a new instance of the passive filter for the node type specified as template class parameter. The name of the filter is set to strName.

bool DisconnectSource(fsf::CCell *pCell)

Disconnects cell pCell from its source: if m_pSource is not NULLL, removes pCell from the list of cell pointers in the source, and sets m_pSource to NULL in the cell. Returns true if successful, false otherwise.

bool DisconnectStream(fsf::CCell *pCell)

Disconnects cell pCell from the active stream: if m_pUpstreamCell is not NULL, remove pCell from upstream cell's list of downstream cell pointers, and set pUpstream cell to NULL. Also disconnects pCEll from all its eventual downstream cells. Returns true if successful, false otherwise.

template <typename Type> bool SetValue(std::string &strNodeName, const Type &val, fsf::CSource *pSource)

Template function, sets a type node's value: creates a type cell matching string ID strCellID, sets its passive filter's name to strNodeName, connects type cell to pSource, creates type node for data type Type, sets value to val, creates an active pulse including the node and sends to type cell. Returns true if pulse is sent successfully. Success does not guaranty that the value is set.

index

C

D

G

ARJF © 2003-2007