![]() |
Telelogic Rhapsody (steve huntington) | ![]() |
Topic Title: Composition & Multiplicity Topic Summary: And C++ Code Generation Created On: 1-Feb-2008 19:19 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
If I create a composition relationship with "*" multiplicity; I get C++ APIs in the generated code like "XXX* newXXX()" and "void deleteXXX()".
If I create a composition relationship with "0,1" multiplicity; shouldn't I get APIs like that as well? Instead, the generated code contains only "XXX* getXXX()"; how is that any different from "1" multiplicity? Thanks, -Garrett |
|
![]() |
|
![]() |
|
If i understand this right than you don't need to allocate any memory if you have only 0,1 multiplicity. The memory is already allocated for that matter. And you only need a getter and setter methods to alter this value.
But if you have * multiplicity than the program does not know the amount of objects you would like to create in the future so it will provide you a method to allocate memory dynamically during runtime. hope this could help regards mike |
|
![]() |
|
![]() |
|
Hi Mike,
What I'd like to be able to do is fulfill the "0" side of the "0,1" multiplicity by deleting the composed object from the parent. I can't do this with only a getter API. -Garrett |
|
![]() |
Telelogic Rhapsody
» Rhapsody Category » Rhapsody
»
Composition & Multiplicity
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.