Book a Demo

Author Topic: Code Generation with Namespaces  (Read 2791 times)

Andreas_G

  • EA User
  • **
  • Posts: 125
  • Karma: +0/-0
  • And that's the way the cookie crumbles.
    • View Profile
Code Generation with Namespaces
« on: September 20, 2005, 12:22:03 am »
Hi Folks,

I have a problem with namespaces during code generation.

This time, I don't have the problems with generating the namespaces again, it's a problem with classes that refer to other classes in other namespaces.

One example:
I have classA in namespaceA. And I have classB in namespaceB.

classA has a method with a parameter of type classB: myFunc(classB).

normaly the code generater should create something like this (C++):

Code: [Select]
namespace namespaceA
{
  classA
  {
                              myFunc(namespaceB::classB b);
  }
}

But it generates this:
Code: [Select]

namespace namespaceA
{
  classA
  {
                              myFunc(classB b);
  }
}

Since the namespaceB is missing on the parameter b in myFunc, the compiler didn't find classB and can't compile my code.

Any solutions?

bye
Andreas


bye
Andreas

AshK

  • EA User
  • **
  • Posts: 137
  • Karma: +0/-0
    • View Profile
Re: Code Generation with Namespaces
« Reply #1 on: September 20, 2005, 04:37:00 pm »
Hi Andreas,

I can successfully generate the right code using build 770.

The only way that I've been able to achive the results that you are getting is if package B is set to a namespace root.

Please ensure that this is not the case in your model (right click package B, select Package Control->Clear Namespace root).

Hope this works,

Ash
The Sparx Team
[email protected]

Andreas_G

  • EA User
  • **
  • Posts: 125
  • Karma: +0/-0
  • And that's the way the cookie crumbles.
    • View Profile
Re: Code Generation with Namespaces
« Reply #2 on: September 21, 2005, 04:30:09 am »
I found the problem. It was a bug in our code generation templates.  ::)

Thanks for your anser Ash
bye
Andreas