Book a Demo

Author Topic: Nested namespaces  (Read 3101 times)

sigjore

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Nested namespaces
« on: June 29, 2007, 05:52:38 am »
I am trying to set a model that in the end shall generate code with nested namespaces (C++).

I have imported source code with nested namespaces and EA (6.5)structures the packages just as expected, i.e one package including several sub-packages.
My new model is structured in the same way but the code doesnt look the same, i.e no nested namespaces.
Is there a setting I have missed or doesnt EA support this?


Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Nested namespaces
« Reply #1 on: July 01, 2007, 01:01:47 pm »
Are you talking about generation of a new model doesn't result in namespaces?

If that's the case, try going to the C++ options page (Tools | Options | Source Code Engineering | C++) and enabling namespaces.

sigjore

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Nested namespaces
« Reply #2 on: July 01, 2007, 10:09:14 pm »
Namespaces are generated but not as I hoped.

In the headers for the sub packages I get this:

namespace sub1{
//code
}

when I want:

namespace main{
 namespace sub1{
   //code
 }
}


Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Nested namespaces
« Reply #3 on: July 02, 2007, 01:08:26 pm »
Okay, well make sure that there is a package 'main' above your package 'sub1', and that neither are a namespace root.  (http://www.sparxsystems.com.au/EAUserGuide/index.html?namespaces.htm)