![]() | ![]() Main Index |
| MCA2 Programmer's Guide | ||||
|---|---|---|---|---|
| Prev | Fast Backward | Fast Forward | Next | |
In groups modules are arranged in a level based order where they are executed in an effective way. The arrangement on levels is done automatically. The user just has to create modules and connect their IOs with Edges. Therefore all modules need a parent. Usually this is a group. (Also a part and thread containers may be used as parents, but this is explained in next chapters). As tGroup inherits class tModule, all groups may be used as all other simple modules and also integrated in groups.
Module are created just by calling the constructor of the corresponding class. All module constructors need at least a pointer to a parent. Within the constructor of a group this will be in most cases the group itself
Example 2-1. Creating modules in a group constructor
tTestGroup::tTestGroup(tParent *parent, bool fixit):
tGroup(parent,"TestGroup",
eSI_DIMENSION, eSO_DIMENSION,eCI_DIMENSION, eCO_DIMENSION,
si_description, so_description, ci_description, co_description)
{
mModuleA *module_a=new mModuleA(this);
mModuleB *module_b=new mModuleB(this,5,6,"hello world");
.
: |
The definitions of the groups IOs are similar to the simple module ones. Note, that groups never own parameters, thus there is no need to define some.