How to put comments in c++ header only

How to put comments in c++ header only

Postby Dan » Sat 2 Jun 2018 10:12

Hi all,

Anyway to put class comments (from the class -> uml -> description edit box) into header files only, not cpp files?

Thanks.
Dan
 
Posts: 33
Joined: Sat 12 May 2018 13:55
Location: England

Re: How to put comments in c++ header only

Postby Bruno Pagès » Sat 2 Jun 2018 11:26

Hello,

I do not understand, the comment (description) of a class is only generated in the header file, not in the source file, so the behavior is already the one you expect
ImageAuthor of Bouml
Bruno Pagès
 
Posts: 596
Joined: Mon 20 Feb 2012 09:23
Location: France

Re: How to put comments in c++ header only

Postby Dan » Sat 2 Jun 2018 13:31

Hi,

As you can see below, the comment appears in header and cpp, I want it only in header.

Code: Select all
// header snippet
...
class ComMission  {
  public:
    /**
     * complete missonId
     */
    int missonComplete(int missonId);
...

Code: Select all
// source snippet
/**
 * complete missonId
 */
int missonComplete(int missonId) {
}


I removed {comment} from generation settings c++[1] in the source file box and created a new test class but no change.

I notice that {comment} is in the operation dialog for the definition, so I removed that and then comment was not generated.

If generation setting c++[4] comment removed it works for new classes only, for existing classes you need to click default definition in the operation c++ dialog. This is a pain when there are loads of classes!

Any way to automate changes in generation settings to existing classes ?

Thanks.
Dan
 
Posts: 33
Joined: Sat 12 May 2018 13:55
Location: England

Re: How to put comments in c++ header only

Postby Bruno Pagès » Sat 2 Jun 2018 15:30

Dan wrote:As you can see below, the comment appears in header and cpp, I want it only in header.

you was speaking about comment/descrirption of class, but here this the one of an operation, this is not the same

Dan wrote:I removed {comment} from generation settings c++[1] in the source file box and created a new test class but no change.

At the artifact level ${comment} produces the description of the artifact, so of course there is no change at class level or under

Dan wrote:I notice that {comment} is in the operation dialog for the definition, so I removed that and then comment was not generated.

Yes, to remove the comment/description at operation level you have to remove ${comment} on the operation, this is logical no ?

Dan wrote:If generation setting c++[4] comment removed it works for new classes only, for existing classes you need to click default definition in the operation c++ dialog. This is a pain when there are loads of classes!

Any way to automate changes in generation settings to existing classes ?

We already speak about that, and I already said you you can automate changes on existing definitions, please read again https://www.bouml.fr/phpbb/viewtopic.php?f=2&t=490&#p1313 ;)
ImageAuthor of Bouml
Bruno Pagès
 
Posts: 596
Joined: Mon 20 Feb 2012 09:23
Location: France


Return to Examples - How to do / Exemples - Comment faire

Who is online

Users browsing this forum: No registered users and 1 guest

cron