Acoustic Research Tool (ART)  v0.10
ARTtimeModule Class Reference

This class is a generic time module and allows the user to create individual ports which can be connected to any other class implementing the ARTItimeModule interface.

It implements all abstract methods of the ARTItimeModule class and additionally provides methods to add output ports and local parameters to the current time module. Output ports of a module can access local and global paremters as well as other output and input ports of the same time module. Output ports of other time modules can be accessed by creating an input port and referencing the output port of the other time module.

Inheritance diagram for ARTtimeModule:
ARTItimeModule ARTobject ARTcell

Public Member Functions

 ARTtimeModule (const string &name="TimeModule", const string &sds="", const string &lds="", const string &htm="")
 Constructor of the ARTtimeModule class.
virtual ARTItimeModuleCreate (const string &name, const string &sds="", const string &lds="", const string &htm="")
 Factory function which creates a new generic time module object with the given input parameters.
virtual void addIPort (const string &name, const ARTdataProp *refPort)
 Adds a new input port to the current time module.
virtual void addOPort (const string &name, const string &expr, unsigned int size=20)
 Creates a new output port to the.
virtual void addLocalParameter (const string &name, const string &expr)
 Adds a new local parameter with the given name and evaluation expression to the current time module.
virtual void addLocalParameter (const string &name, const double val)
 Adds a new local parameter with the given name and initial value to the current time module.
virtual void addLocalParameter (const string &name, const std::complex< double > &val)
 Adds a new local parameter with the given name and initial value to the current time module.
virtual void addGlobalParameter (const ARTdataProp *parameter)
 Adds a global parameter to the current time module by registering it to all output ports and local parameters.
virtual void removeGlobalParameter (const string &name)
 Removes the definition of the given global parameter from all output ports and local parameters.
virtual void setCurrentIndex (int idx)
 Sets the current time module and all output ports to the given time index.
virtual void simulateCurrentIndex (int idx)
 Triggers the evaluation of all output ports of the time module for the given time index.
virtual ~ARTtimeModule ()
 Destructor of the ARTtimeModule class.
- Public Member Functions inherited from ARTItimeModule
 ARTItimeModule (const string &name, const string &sds="", const string &lds="", const string &htm="")
 Constructor of the ARTItimeModule class.
 ARTItimeModule (const ARTItimeModule &orig)
 Copy constructor which creates a new time module based on the given time module.
virtual ARTdataPropgetPort (const string &name)
 Returns a pointer to the port object with the given name.
virtual void setLocalParameter (const string &name, const string &expr)
 Sets the definition of the local parameter with the given name.
virtual void setLocalParameter (const string &name, const std::complex< double > &val)
 Sets the definition of the local parameter with the given name.
virtual void setLocalParameter (const string &name, const double val)
 Sets the definition of the local parameter with the given name.
virtual void setSimulator (ARTsimulator *sim)
 Sets the simulator of the current time module and all its output ports.
virtual ~ARTItimeModule ()
 Destructor of the ARTItimeModule class.
- Public Member Functions inherited from ARTobject
 ARTobject (const string name, const string sds="", const string lds="", const string htm="")
 objects must have a name, the rest is optional
 ARTobject (const ARTobject &orig)
 copy constructor
virtual ARTcellclone ()
ARTpropertyGetProperties (ARTproperty *pos)
 iterate through property list (pass NULL to restart iteration, receive NULL after last element)
ARTpropertyFindProperty (const string nam)
 find and return named property (or return NULL if no match)
ARTpropertyAppendProperty (const string name, const string sds="", const string lds="", const string htm="")
 Append new property with given name to ARTobject.
ARTdataPropAppendDataProp (const string name, ARTvariant *val, const string sds="", const string lds="", const string htm="")
 append new data property with given name to ARTobject
ARTdataPropAppendDataProp (const string name, const double val, const string sds="", const string lds="", const string htm="")
ARTdataPropAppendDataProp (const string name, const float val, const string sds="", const string lds="", const string htm="")
ARTdataPropAppendDataProp (const string name, const string val, const string sds="", const string lds="", const string htm="")
ARTdataPropAppendDataProp (const string name, const int val, const string sds="", const string lds="", const string htm="")
ARTdataPropAppendDataProp (const string name, const string *val, const string sds="", const string lds="", const string htm="")
ARTdataPropAppendDataProp (ARTdataProp *dataProp)
ARTlistPropAppendListProp (const string name, const string sds="", const string lds="", const string htm="")
 append new listableProperty with given name
bool DeleteProperty (ARTproperty *prp)
 delete current property (which was recently accessed by GetProperties, FindProperty or AppendProperty)
ARTmethodGetMethods (ARTmethod *pos)
 iterate through method list (pass NULL to restart iteration, receive NULL after last element)
ARTmethodFindMethod (const string nam)
 find and return named method (or return NULL if no match)
ARTmethodAppendMethod (const string name, const string sds="", const string lds="", const string htm="")
 append new method with given name
bool DeleteMethod (ARTmethod *mtd)
 delete current method (which was recently accessed by GetProperties, FindProperty or AppendProperty)
void SetPropertyList (list< ARTproperty * > &l)
void CopyPropertyListEntries (ARTobject *obj)
 copies properties from other objects (also copying the objects of all list-entries). OVERWRITES list own list!
void CopyMethodListEntries (ARTobject *obj)
 copies methods from other objects (also copying the objects of all list-entries). OVERWRITES list own list!
list< ARTproperty * > GetPropertyList ()
list< ARTmethod * > GetMethodList ()
- Public Member Functions inherited from ARTcell
 ARTcell (const string name="", const string sds="", const string lds="", const string htm="")
 ARTcell (const ARTcell &orig)
const string & GetName () const
const string & GetShortDescription () const
const string & GetLongDescription () const
const string & GetHelpFilename () const
void SetName (const string name)

Protected Member Functions

virtual void addVariableToParsers (const string &name, const Variable &var)
 Registers the variable with the given name to the parsers of all output ports and local parameters.
virtual void removeVariableFromParsers (const string &name)
 Removes the reference of the variable with the given name from the parsers of all output ports and local parameters.
virtual void registerAllVariablesToParser (ParserX *parser)
 Register all locally available variables (from input ports, output ports, local and global parameters) to the given parser object.
virtual void clean ()
 Cleans up the class before it is destroyed.

Additional Inherited Members

- Protected Attributes inherited from ARTItimeModule
ARTtimeSimulator_simulator
 Simulator object to which the current time module belongs.

Constructor & Destructor Documentation

ARTtimeModule::ARTtimeModule ( const string &  name = "TimeModule",
const string &  sds = "",
const string &  lds = "",
const string &  htm = "" 
)
explicit

Constructor of the ARTtimeModule class.

Parameters
[in]nameRepresents the unique identifier of the time module.
[in]sdsShort description (single line) of the time module.
[in]ldsLong description of the time module.
[in]htmPath to help file in HTML format.

Member Function Documentation

void ARTtimeModule::addGlobalParameter ( const ARTdataProp parameter)
virtual

Adds a global parameter to the current time module by registering it to all output ports and local parameters.

Parameters
[in]parameterPointer to the global parameter object.
Exceptions
ARTerrorIf the given object is no valid global parameter or there is another property with the same name.

Reimplemented from ARTItimeModule.

void ARTtimeModule::addIPort ( const string &  name,
const ARTdataProp refPort 
)
virtual

Adds a new input port to the current time module.

Parameters
[in]nameLocally unique identifier of the new input port.
[in]refPortPointer to an existing output port which will be associated with the new input port.
Exceptions
ARTerrorIf the given name already exists for another object in the current time module.

Implements ARTItimeModule.

void ARTtimeModule::addLocalParameter ( const string &  name,
const string &  expr 
)
virtual

Adds a new local parameter with the given name and evaluation expression to the current time module.

Parameters
[in]nameLocally unique identifier.
[in]exprA parser expression defining the value of the local parameter.
Exceptions
ARTerrorIf another object (parameter or port) with the same name already exists in the current time module.
void ARTtimeModule::addLocalParameter ( const string &  name,
const double  val 
)
virtual

Adds a new local parameter with the given name and initial value to the current time module.

Parameters
[in]nameLocally unique identifier.
[in]valReal initial value of the local parameter.
Exceptions
ARTerrorIf another object (parameter or port) with the same name already exists in the current time module.
void ARTtimeModule::addLocalParameter ( const string &  name,
const std::complex< double > &  val 
)
virtual

Adds a new local parameter with the given name and initial value to the current time module.

Parameters
[in]nameLocally unique identifier.
[in]valComplex initial value of the local parameter..
Exceptions
ARTerrorIf another object (parameter or port) with the same name already exists in the current time module.
void ARTtimeModule::addOPort ( const string &  name,
const string &  expr,
unsigned int  size = 20 
)
virtual

Creates a new output port to the.

Parameters
[in]nameThe locally unique name of the port.
[in]exprA parser expression
[in]sizeOptional parameter defining the size of the ring buffer. Default is 20.
Exceptions
ARTerrorIf another object (parameter or port) with the same name already exists in the current time module.
void ARTtimeModule::addVariableToParsers ( const string &  name,
const Variable &  var 
)
inlineprotectedvirtual

Registers the variable with the given name to the parsers of all output ports and local parameters.

Parameters
[in]nameName of the variable. Must be identical to the name used in all parser expressions.
[in]varReference to the variable object which will be registered.
ARTItimeModule * ARTtimeModule::Create ( const string &  name,
const string &  sds = "",
const string &  lds = "",
const string &  htm = "" 
)
virtual

Factory function which creates a new generic time module object with the given input parameters.

Parameters
[in]nameRepresents the unique identifier of the time module.
[in]sdsShort description (single line) of the time module.
[in]ldsLong description of the time module.
[in]htmPath to help file in HTML format.

Implements ARTItimeModule.

void ARTtimeModule::registerAllVariablesToParser ( ParserX *  parser)
inlineprotectedvirtual

Register all locally available variables (from input ports, output ports, local and global parameters) to the given parser object.

Parameters
[in]parserPointer to the parser to which all current variables will be registered.
void ARTtimeModule::removeGlobalParameter ( const string &  name)
virtual

Removes the definition of the given global parameter from all output ports and local parameters.

Parameters
[in]nameThe name of the global parameter.
Exceptions
ARTerrorIn case no global parameter with the given name could be found in the current time module.

Reimplemented from ARTItimeModule.

void ARTtimeModule::removeVariableFromParsers ( const string &  name)
inlineprotectedvirtual

Removes the reference of the variable with the given name from the parsers of all output ports and local parameters.

Parameters
[in]nameThe identifier of the variable which shall be removed.
void ARTtimeModule::setCurrentIndex ( int  idx)
virtual

Sets the current time module and all output ports to the given time index.

Parameters
[in]idxThe time index which will be set.

Implements ARTItimeModule.

void ARTtimeModule::simulateCurrentIndex ( int  idx)
virtual

Triggers the evaluation of all output ports of the time module for the given time index.

Parameters
[in]idxThe time index which will be simulated.

Implements ARTItimeModule.