![]() |
Telelogic Rhapsody (steve huntington) | ![]() |
Topic Title: Using OMContainer & OMIterator? Topic Summary: Created On: 12-Sep-2007 11:15 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Hi,
I attached a simple model to this post which concerns about using OMContainer and OMIterator. In the model there is one Father-class and two child classes (Child1 and Child2) which are related to their father by (one to many) aggregation. Father-class has a structured diagram where I have created two instances of Child1-class. After the program starts the father should iterate the container and call print()-method for every member in the container like this: [CODE] OMIterator<Child1*> iChild1(getItsChild1()); iChild1.reset(); // point to first while ( *iChild1 != NULL ) { (*iChild1)->print(); // print ++iChild1; // point to next } OMIterator<Child2*> iChild2(getItsChild2()); iChild2.reset(); // point to first while ( *iChild2 != NULL ) { (*iChild2)->print(); // print ++iChild2; // point to next }[/CODE] Problem is that the container seems to be empty and I can't find a solution how to add parts dynamically to the OMContainer. I would higly appreciate any advice to this problem! Have I understood right that all the created classes that have a relation to (in this case) the father-class should be added to the OMContainer automatically? Thanks in advance! Matti |
|
![]() |
|
![]() |
|
Problem solved...
|
|
![]() |
Telelogic Rhapsody
» Rhapsody Category » Rhapsody
»
Using OMContainer & OMIterator?
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.