To-many relations

To-many relations are implemented by collections of pointers using the OMCollection template.

If E is a class name multiply related to F by role name role, E contains the following data member:

OMCollection<F*> role;

The following methods are generated in E to manipulate this relation:

For example, if you want to send event X to each of the related F objects, use the following code:

   OMIterator<F*> iter(anE->getRole());
   while(*iter)
   {
      *iter->GEN();
      iter++;
   }

In this code, anE is an instance of E.

These defaults are modifiable through the properties of the role.


Feedback