Book a Demo

Author Topic: Source Code Import - Operation notes issue  (Read 3626 times)

renato178

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Source Code Import - Operation notes issue
« on: June 11, 2019, 07:08:35 pm »
Hi,

I'm trying to import a cpp code but the structure of my code that is defined as follow:

declarations.h
declarations.cpp
file1.cpp
file2.cpp
file3.cpp
...
most of the functions  defined into file1.cpp, file2.cpp , file2.cpp, etc.. present their definitions in declarations.h

As indicated into "Notes on Source Code Import" for EA :"Enterprise Architect automatically searches for the .cpp implementation file based on the extension and search path set in the C++ options; when it finds the implementation file, it can use it to resolve parameter names and method notes as necessary."

In my case when I import the code, EA just only import the operation notes of the functions defined into declarations.cpp and doesn't recognize the operation notes of the functions defined into file1.cpp, file2.cpp, etc..

Is there any kind of configuration in order to solve it and import all of them?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8104
  • Karma: +118/-20
    • View Profile
Re: Source Code Import - Operation notes issue
« Reply #1 on: June 12, 2019, 09:00:06 am »
The only way EA will be able to import notes from the functions defined in filen.cpp is if you put a comment in the header. EA uses matching pairs of header and implementation files when identifying implementations for functions.

renato178

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Source Code Import - Operation notes issue
« Reply #2 on: June 12, 2019, 03:50:59 pm »
Yes, I have comments in the header for all function declarations but the problem is that if the the function definition file name (*.cpp) doesn't present the same name of the function declaration file name (*.h) EA doesn't import the comment.

As I mentioned for the example:
declarations.h
declarations.cpp
file1.cpp
file2.cpp
file3.cpp

all notes (in declarations.h) of the functions defined in declarations.cpp are correctly imported, but the notes (in declarations.h) of the functions defined in file1.cpp, file2.cpp, file3.cpp are not imported.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13505
  • Karma: +572/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Source Code Import - Operation notes issue
« Reply #3 on: June 12, 2019, 04:00:34 pm »
I think what Eve means is that you have to have a file1.h file as well, even if it only contains comments.

Geert

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8104
  • Karma: +118/-20
    • View Profile
Re: Source Code Import - Operation notes issue
« Reply #4 on: June 13, 2019, 08:39:27 am »
When parsing C++ EA looks primarily at header files. When processing a header it will also search for a single matching implementation file, it then looks for a matching definition for any declarations it finds.

It will not find a definition (and therefore any comment associated with it) when the implementation file doesn't match the header file.

I suspect that EA is configured to only read notes from the implementation file.

Check the options in Start > Desktop > Preferences > Source Code Engineering > C++.

You'll find 'Method Notes in Header' and 'Method Notes in Implementation'.