Book a Demo

Author Topic: C++ code generation, namespaces?  (Read 3962 times)

misio

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
C++ code generation, namespaces?
« on: November 14, 2008, 11:51:24 am »
Hi, dear sparks, do you plan to have it any time soon?  We are using C++ here, and lack of C++ namespaces have rendered EA pretty much unusable.  I have commented out the check for genOptCPPGenNamespace parameter, namespaces appeared, but the references to classes in other namespaces are incorrect.

Sincerely,
Mikhail

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: C++ code generation, namespaces?
« Reply #1 on: November 14, 2008, 04:45:14 pm »
Generation of namespaces for C++ is optional.  Go to Tools | Options | Source Code Engineering | C++ and turn it on.

misio

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: C++ code generation, namespaces?
« Reply #2 on: November 15, 2008, 06:50:56 am »
Hi Simon,

did that, with mixed result.  If A::C inherits A::B::D ( smiley is not intended, he-he) the code looks like:

Code: [Select]

#include "D.h"

class C : public B::D


I believe correct code would be

Code: [Select]

#include "B/D.h"

class C : public B::D


What do you think?

Good luck to us,
Mikhail

Quote
Generation of namespaces for C++ is optional.  Go to Tools | Options | Source Code Engineering | C++ and turn it on.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: C++ code generation, namespaces?
« Reply #3 on: November 17, 2008, 08:20:09 am »
Well, EA doesn't generate includes with relative paths... But that's a separate issue, with multiple possible resolutions.

1. There are substitution macros that get a relative path to the include.  You could modify the templates and use those.

2. If you specify a local path, EA will generate all includes for classes below that path, from that point.  This works well if you've specified an include path for your compiler to point at that top level directory.