• 1 reply
  • Latest Post - ‏2012-11-11T13:58:49Z by SystemAdmin
19 Posts

Pinned topic subpackages with the same name

‏2012-11-08T15:53:43Z |
In Rhapsody for c++ with flat code generation... I have several sub packages called Interface. For example Package A has Interface sub package and so does package B. If A::Interface has global variable "int test" and B::Interface has global variable "bool test" then only one variable "test" is generated inside of Interface.h. This is a problem because the compiler doesn't care and I could be using the wrong global variable in my code without realizing it.

IS that intended behavior and what is the workaround? Do people make sure they never have two packages with the same name? OR is there a property you can override to make the generated names unique? I noticed CG::Package::Filename, but it would be annoying if you had to do this for every package with the same name. Is there a way to make this property create more unique names by setting it to something like $parent$name? I tried that and $parent does not resolve to anything. This brings up a more general question... where can I find a list of variables like $name that can be used in properties.
Updated on 2012-11-11T13:58:49Z at 2012-11-11T13:58:49Z by SystemAdmin
  • SystemAdmin
    1305 Posts

    Re: subpackages with the same name


    By default when you create in the model Package with name of existing package - you get warning and can make your decision if to give the same name or not.

    Using of the property CG::Package::Filename to get different file to Packages with same name is good.
    I don't think there is a keyword that will be helpful for this case, but here is the list:

    Another solution will be to use CG SDK to set the file name during code generation, but this sound as overkill, while you can give different names to the packages in the first place.