VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
DtSimBlock Class Referenceabstract

class DtSimBlock:

Instances of DtSimBlock represents blocks of DtSimStatements.

Inheritance diagram for DtSimBlock:
Inheritance graph
[legend]

Public Member Functions

 DtSimBlock (DtSimStatement *parentStatement)
 
 DtSimBlock (const DtString &name, DtSimStatement *parentStatement, DtReaderWriterRegistry *parentRegistry=NULL)
 
 DtSimBlock (const DtSimBlock &orig)
 
 DtSimBlock (const DtString &name, const DtSimBlock &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 
virtual ~DtSimBlock ()
 
DtSimBlockoperator= (const DtSimBlock &orig)
 
virtual DtSimBlockclone (const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL) const =0
 
DtSimBlockclone () const
 
DtSimStatementfirstStmt () const
 
DtSimStatementlastStmt () const
 
virtual DtlObjPtr getData (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings)
 
virtual void exitFromBlock (DtPlan &)=0
 
virtual bool translateIndex (DtStmtIndex &stmtIndex)
 
virtual void translateIndices (DtList &stmtIndexList)
 
virtual DtSimStatementlookupStatement (DtStmtIdType statementId)
 
virtual
DtRecursiveSimBlockIterator
spawnRecursiveIterator () const
 
virtual bool validate ()
 
virtual bool isSameBlock (DtSimBlock *rhs)
 
void setParentStatement (DtSimStatement *)
 
DtSimStatementparentStatement () const
 
virtual DtListItem * addToList (DtRwListedObj *data, DtRwListedObj *after)
 
virtual void upgradeTriggerUUID (const boost::unordered_map< DtUUID, DtUUID > &)
 
virtual void reset ()
 
- Public Member Functions inherited from DtRwIntrusiveList
 DtRwIntrusiveList ()
 
 DtRwIntrusiveList (const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL)
 
 DtRwIntrusiveList (const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL)
 
 DtRwIntrusiveList (const DtString &name, const DtRwIntrusiveList &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 
 DtRwIntrusiveList (const DtSymbolString &name, const DtRwIntrusiveList &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 
virtual ~DtRwIntrusiveList ()
 
DtRwIntrusiveListoperator= (const DtRwIntrusiveList &orig)
 
DtRwListedObjfirstObj () const
 
DtRwListedObjlastObj () const
 
DtListItem * first () const
 
DtListItem * last () const
 
unsigned count () const
 
DtListItem * add (DtRwListedObj *data)
 
DtListItem * addToStart (DtRwListedObj *data)
 
DtListItem * addToEnd (DtRwListedObj *data)
 
DtListItem * addBefore (DtRwListedObj *data, DtRwListedObj *before)
 
DtListItem * addAfter (DtRwListedObj *data, DtRwListedObj *after)
 
DtRwListedObjremove (DtRwListedObj *data)
 
virtual DtRwListedObjremove (DtListItem *item)
 
void removeAndDelete (DtRwListedObj *data)
 
virtual void removeAndDelete (DtListItem *item)
 
virtual void removeAll ()
 
virtual void removeAllAndDelete ()
 
DtListItem * itemLookup (DtRwListedObj *data) const
 
virtual void getSelf (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings)
 
virtual DtlObjPtr getLocalData (DtlObjPtr args)
 
virtual const charreaderWriterType () const
 
- Public Member Functions inherited from DtReaderWriter
 DtReaderWriter ()
 
 DtReaderWriter (const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false)
 
 DtReaderWriter (const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false)
 
 DtReaderWriter (const DtString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 
 DtReaderWriter (const DtSymbolString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL)
 
 DtReaderWriter (const DtReaderWriter &, DtReaderWriterRegistry *parentRegistry=NULL)
 
const DtReaderWriteroperator= (const DtReaderWriter &orig)
 
bool operator== (const DtReaderWriter &) const
 
bool operator!= (const DtReaderWriter &rhs)
 
virtual ~DtReaderWriter ()
 
virtual void putSelf (std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
 
virtual void postPutSelf ()
 
virtual void prePutSelf ()
 
virtual void postGetSelf ()
 
virtual void preGetSelf ()
 
virtual void writeSelf (std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
 
virtual DtSymbolString name () const
 
virtual void addAlias (const DtSymbolString &alias)
 
virtual void addAlias (const DtString &alias)
 
virtual bool hasAlias (const DtSymbolString &alias)
 
virtual const aliasContaineraliases () const
 
virtual void setReadonly (bool flag)
 
bool isReadonly () const
 
virtual int alignment () const
 
virtual bool variableIsBound () const
 
virtual void unbindVariable ()
 
virtual void setName (const DtString &)
 
virtual const charxmlType () const
 
virtual DtString prettyPrint () const
 
std::string debugText () const
 
virtual void bindVariables (DtVariableBindingsList variableBindings)
 
virtual std::list
< DtVariableNameType
unboundVariables () const
 
bool invalid () const
 
virtual bool hasChild (const DtReaderWriter *p) const
 
virtual bool hasVariableReference () const
 
virtual void bindLocalVariables (const DtVariableBindingsList &variableBindings)
 
virtual void recordUpdateTime () const
 
virtual bool wasUpdatedSince (DtTime t) const
 
virtual bool changedSinceLastChecked ()
 
virtual bool peekChangedSinceLastChecked () const
 
virtual void putData (std::string &fp, int indentLevel=0)
 
virtual void setValueSpecified (bool specified, bool recurse=false)
 
virtual bool valueSpecified () const
 
virtual bool isVariableReference () const
 
virtual void setIsVariableReference (bool value)
 
virtual void clearAllVariableReferenceFlags ()
 
virtual DtSymbolString variableName () const
 
virtual void setVariableName (const DtSymbolString variableName)
 
virtual const DtReaderWriterdefaultRWValue () const
 
virtual DtReaderWriterdefaultRWValue ()
 
virtual void setDefaultRWValue (DtReaderWriter *)
 
virtual bool checkAndSetDefaultRWValue (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference())
 
const DtReaderWriterRegistryregistry () const
 
DtReaderWriterRegistryregistry ()
 
virtual DtPropertyInterfaceproperty ()
 
virtual const DtPropertyInterfaceproperty () const
 
virtual DtString toXml () const
 
virtual DtRwVariableBindingsgenerateVariableBindings () const
 
virtual bool toXml (const DtFilename &) const
 
virtual bool fromXml (const DtString &)
 
virtual bool fromXmlFile (const DtFilename &)
 
virtual void putSelf (DtEnvironmentSP, DtEnvValueSP parent) const
 
virtual void putData (DtEnvironmentSP, DtEnvValueSP value) const
 
virtual void putVariableReference (DtEnvironmentSP, DtEnvValueSP value) const
 
virtual void getSelf (const DtEnvironmentSP, const DtEnvValueSP root, const SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &bindings=DtVariableBindingsList())
 
virtual void getData (const DtEnvironmentSP, const DtEnvValueSP, const SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &bindings=DtVariableBindingsList())
 
virtual void unrecognizedItem (const DtEnvironmentSP env, const DtEnvValueSP root, const SearchPaths &searchPaths, const DtVariableBindingsList &varBindings)
 
virtual void getVariableReference (DtEnvironmentSP, DtEnvValueSP value)
 

Protected Member Functions

virtual void cloneListFrom (const DtSimBlock &other)
 
- Protected Member Functions inherited from DtRwIntrusiveList
 DtRwIntrusiveList (const DtRwIntrusiveList &orig)
 
- Protected Member Functions inherited from DtReaderWriter
virtual void bindToRwAsVariable (const DtReaderWriter *rw)
 

Protected Attributes

DtSimStatementmyParentStatement
 
- Protected Attributes inherited from DtRwIntrusiveList
DtList myList
 
- Protected Attributes inherited from DtReaderWriter
const DtSymbolString myName
 
DtReaderWriterRegistry myRegistry
 
DtReaderWriterRegistrymyParentRegistry
 
bool myValueSpecified
 
bool myReadOnlyFlag
 
bool myIsVariableReference
 
DtSymbolString myVariableName
 
bool myVariableIsBound
 
DtReaderWritermyDefaultValue
 
aliasContainer myAliases
 
bool myInvalid
 
bool myChangedFlag
 

Additional Inherited Members

- Public Types inherited from DtReaderWriter
typedef std::vector
< DtSymbolString
aliasContainer
 
typedef std::vector
< DtSymbolString >::iterator 
aliasIter
 
typedef std::vector
< DtSymbolString >
::const_iterator 
aliasConstIter
 
typedef std::vector< DtFilename > SearchPaths
 
typedef std::pair
< DtSymbolString, DtString
DtVariableNameType
 
typedef DtReaderWriterFactory *(* DtReaderWriterFactoryCreatorFcn )()
 
- Static Public Member Functions inherited from DtReaderWriter
static void putIndent (std::string &fp, int indentLevel)
 
static const
DtVariableBindingsList
nullVariableReference ()
 
static void setPostGetSelfCallback (DtGetSelfCallbackFcn fcn, void *usrData)
 
static void setPrePutSelfCallback (DtPutSelfCallbackFcn fcn, void *usrData)
 
static void setPutIndent (bool)
 
static bool putIndent ()
 
static const chartheXmlType ()
 
static const DtFilename & appPath ()
 
static void setFactoryCreatorFunction (DtReaderWriterFactoryCreatorFcn fcn)
 
static void createReaderWriterFactory ()
 
static void cleanupFactory ()
 
static DtReaderWriterFactoryfactory ()
 
static void setOutputStream (DtOutputStream *stream)
 
static DtOutputStream & outputStream ()
 
static DtReaderWritercreateFromXmlFile (const DtFilename &, bool createAsProperty=false)
 
static DtReaderWritercreateFromXml (const DtString &, bool createAsProperty=false)
 
static DtReaderWritercreateFromEnvironment (DtEnvironmentSP, bool createAsProperty=false)
 
static DtString getAttribute (DtEnvironmentSP env, const DtString &name, DtEnvValueSP root)
 
- Static Protected Attributes inherited from DtReaderWriter
static DtString theUnspecifiedValue
 
static DtGetSelfCallbackInfo thePostGetSelfCallback
 
static DtPutSelfCallbackInfo thePrePutSelfCallback
 
static const DtVariableBindingsList theEmptyVariableBindingsList
 
static bool theCreatorFcnSet
 
static DtReaderWriterFactorytheFactory
 
static
DtReaderWriterFactoryCreatorFcn 
theFactoryCreatorFcn
 
static bool thePutIndent
 
static DtOutputStream * theOutputStream
 

Constructor & Destructor Documentation

DtSimBlock::DtSimBlock ( DtSimStatement parentStatement)

default constructor

DtSimBlock::DtSimBlock ( const DtString name,
DtSimStatement parentStatement,
DtReaderWriterRegistry parentRegistry = NULL 
)

real constructor

DtSimBlock::DtSimBlock ( const DtSimBlock orig)

default copy constructor NOTE: this does a deep copy of the statements.

DtSimBlock::DtSimBlock ( const DtString name,
const DtSimBlock orig,
DtReaderWriterRegistry parentRegistry = NULL 
)

better copy constructor NOTE: this does a deep copy of the statements.

virtual DtSimBlock::~DtSimBlock ( )
virtual

destructor NOTE: this DELETES the contained statements.

Member Function Documentation

DtSimBlock& DtSimBlock::operator= ( const DtSimBlock orig)

assignment operator NOTE: this deletes the old statements and does a deep copy of the new ones.

virtual DtSimBlock* DtSimBlock::clone ( const DtString name,
DtReaderWriterRegistry parentRegistry = NULL 
) const
pure virtual

The normal clone function. Clones blocks. This is not normally done outside of the DtPlan or DtSimStatement that owns them.

Implemented in DtIfBlock, DtWhileBlock, DtDoUntilBlock, DtTriggerBlock, and DtPlanBlock.

DtSimBlock * DtSimBlock::clone ( ) const
inline

This clone re-uses the current DtSimBlock's name, but does not register in its parent's plan or registry.

Inline functions.

References DtReaderWriter::name().

DtSimStatement * DtSimBlock::firstStmt ( ) const
inline

Same as firstObj(), except also downcasts. firstStmt() and lastStmt() are wrapper functions that make it easier to access the DtSimStatements inside the block without having to cast the pointers returned by the firstObj() and lastObj() member functions. Once you have a DtSimStatement pointer, you can loop through the list of statements using the DtSimStatement::nextStmt() and DtSimStatement::prevStmt() member functions.

References DtRwIntrusiveList::firstObj().

DtSimStatement * DtSimBlock::lastStmt ( ) const
inline

Same as lastObj(), except also downcasts.

References DtRwIntrusiveList::lastObj().

virtual DtlObjPtr DtSimBlock::getData ( DtlObjPtr  args,
const DtReaderWriter::SearchPaths searchPaths,
const DtVariableBindingsList variableBindings 
)
virtual

This special version of getData creates the necessary list element object using the DtSimStatement::statementFactory, tells the statement to getSelf, and then adds the statement to the DtRwIntrusiveList. The return value is ignored.

Implements DtRwIntrusiveList.

virtual void DtSimBlock::exitFromBlock ( DtPlan )
pure virtual

This function is called by the last statement in the block so that the block can do whatever is appropriate at the end of this block. Called when the last statement in the block is asked to step to the next statement. Since there are no more statements in the block, the last statement asks the block to finish the step command for it. Any class derived from DtSimBlock must define its own exitFromBlock() member function and different blocks do different things on exit. This function, like the DtSimStatement::execute() and DtSimStatement::step(), takes a DtPlan reference argument for the execution context.

Implemented in DtIfBlock, DtPlanBlock, DtWhileBlock, DtTriggerBlock, and DtDoUntilBlock.

virtual bool DtSimBlock::translateIndex ( DtStmtIndex stmtIndex)
virtual

If you have a DtStmtIndex object that used to point into the original DtSimBlock before it was copied/cloned into this one, use the translateIndex function to convert it to point into this Block. Returns true if a match was found, false otherwise.

Reimplemented in DtPlanBlock.

virtual void DtSimBlock::translateIndices ( DtList &  stmtIndexList)
virtual

If you have a list of DtStmtIndex objects that used to point into the original DtSimBlock before it was copied/cloned into this one, use the translateIndicies function to convert them to point into this Block.

virtual DtSimStatement* DtSimBlock::lookupStatement ( DtStmtIdType  statementId)
virtual

Looks up a statement with the given Id. Calls lookupStatement() on each statement.

virtual DtRecursiveSimBlockIterator* DtSimBlock::spawnRecursiveIterator ( ) const
virtual

Spawns an iterator that iterates over the elements in this sim block, and all their children, sub children, etc.. The caller MUST DELETE the iterator when doen using it!

virtual bool DtSimBlock::validate ( )
virtual

Calls validate() on all statements within the block.

Returns
True only if all statements were validated.
virtual bool DtSimBlock::isSameBlock ( DtSimBlock rhs)
virtual

Returns true if all sub statements are the same. Calls isSameStatement on all sub statements.

void DtSimBlock::setParentStatement ( DtSimStatement s)
inline

Sets the parent statement of this block.

References myParentStatement.

DtSimStatement * DtSimBlock::parentStatement ( ) const
inline

Returns parent statement of this block.

References myParentStatement.

virtual DtListItem* DtSimBlock::addToList ( DtRwListedObj data,
DtRwListedObj after 
)
virtual

Add element to the list just after the indicated item. Returns the DtListItem envelope object that contains your new element. NOTE: if this or any other DtRwIntrusiveList functions are used to add a statement to the block, the "data" argument MUST be a DtSimStatement!

Reimplemented from DtRwIntrusiveList.

virtual void DtSimBlock::upgradeTriggerUUID ( const boost::unordered_map< DtUUID, DtUUID > &  )
virtual

For those statements that need to, map from the old to new trigger UUID.

virtual void DtSimBlock::reset ( )
virtual

Called when the plan is reset, will iterate over all statements to reset as well.

Reimplemented from DtReaderWriter.

virtual void DtSimBlock::cloneListFrom ( const DtSimBlock other)
protectedvirtual

This function will clone the statements from the given statement list. Note: it is NOT acceptable to pass "*this" as "other" say, to deepen a shallow list copy. It assumes that this->myList is empty. This is used by the copy constructor(s) as well as by the assignment operator.

Member Data Documentation

DtSimStatement* DtSimBlock::myParentStatement
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)