MCA Logo
MCA Online Reference Documentation
Main Index

Chapter 2. Implementing Groups

Table of Contents
2.1. Integrate modules
2.2. Using ThreadContainers
2.3. Connecting modules using edges
2.4. Build the group
2.5. Inherit from groups

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.

2.1. Integrate modules

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):
  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.