ProcessorManager Class Reference
#include <ProcessorManager.hh>
Inherits Singleton< ProcessorManager >.
List of all members.
Detailed Description
Central manager for all DataProcessor instances.
This class is a central manager for all created instances of DataProcessor classes. It is implemented as a singleton so there is only one instance of this class in a given executable.
All data processors, together with links between them form an acyclic data flow graph.
The update() method of the ProcessorManager class is its main interface. It is responsible from calling the update functions of all the data managers in its database in a proper toplogical order dictated by the underlying dataflow connection graph. Topological sorting of this graph is done whenever necessary (e.g. when new links are added) to ensure proper flow and computation of data across the graph.
Every time a data processor is created, its constructor adds the newly created class to the manager's list through the add() method. Similarly, when a data processor is destroyed, it automatically removes itself from the data manager's list. Finally, whenever a link is established between two data processors, the manager is informed through the link() method.
Member Function Documentation
| int ProcessorManager::findFreeIndex |
( |
const char * |
name |
) |
|
|
|
|
This method returns an unused index for processors with the specified name. |
| DataProcessor* ProcessorManager::findProcessor |
( |
const char * |
name, |
|
|
int |
index |
|
) |
|
|
|
|
This method finds the data processor with the specified name and index and returns a pointer to it. |
| void ProcessorManager::printProcessors |
( |
void |
|
) |
|
|
|
|
This method prints out information about all the processors known to the manager. |
| void ProcessorManager::update |
( |
void |
|
) |
|
|
|
|
This method can be called by an external entity to perform one computation step for all the data processors in the proper order determined by the underlying dataflow graph. Intended usage is periodic calls to this method to perform continuous update of dataflow. |
| double ProcessorManager::updatePeriod |
( |
void |
|
) |
[inline] |
|
|
|
This method returns the externally set update period. |
| void ProcessorManager::updatePeriod |
( |
double |
period |
) |
[inline] |
|
|
|
This method sets the time period between two successive updates. This is needed by some data processors that may do their computations based on elapsed simulation time, such as integrators, derivative operators etc. |
| bool ProcessorManager::verify |
( |
const char * |
msg = NULL |
) |
|
|
|
|
This method checks the input connections of all processors and reports any unconnected ones. It returns true if all inputs are connected. |
SimLib Reference Documentation