C++ code generation issues

General discussions about code engineering

Moderator: Moderators

C++ code generation issues

Postby medvedm@zin-tech.com » Fri Jun 18, 2010 8:17 am

I'm attaching a model that I'm using to generate some C++. It was behaving badly after I had put some code into the functions in the .cpp file, so I backed them up and regenerated the files. Here is an example of the funkiness I got:

/**
* @(#) AcmeApplication.cpp
*/


AcmeApplication * AcmeApplication::instance( )
{
return 0;
}

AcmeApplication::AcmeApplication( ) : MApplication(RACK_CIR,PKG_PIP,SUBPKG_NONE)
{

}

#include "AcmeApplication.h"
#include <iostream>
AcmeApplication * AcmeApplication::pInstance = NULL;

void AcmeApplication::startSystem( )
{

}
...... MORE CODE


What is up with that?
You do not have the required permissions to view the files attached to this post.
medvedm@zin-tech.com
Forum Newbie
Forum Newbie
 
Posts: 9
Posts Rating:0
Joined: Tue Dec 29, 2009 2:45 pm

Re: C++ code generation issues

Postby medvedm@zin-tech.com » Fri Jun 18, 2010 8:21 am

I deleted all the .tmp and .bak files and it seemed to generate much better files.

What are the rules when you edit the source files and then regenerate the code from the model? Can you move stuff around in the file, or does the SW look for things in specific locations? Can you add include directives and other things?
medvedm@zin-tech.com
Forum Newbie
Forum Newbie
 
Posts: 9
Posts Rating:0
Joined: Tue Dec 29, 2009 2:45 pm

Re: C++ code generation issues

Postby medvedm@zin-tech.com » Fri Jun 18, 2010 8:25 am

And actually, if you generate the code out of the model, and then generate it again (changing nothing) you get all kinds of parse problems. Am I doing something wrong? If not, this is pretty awful performance and I don't think I'll be buying this product. It is so close to what I want, too.

M
medvedm@zin-tech.com
Forum Newbie
Forum Newbie
 
Posts: 9
Posts Rating:0
Joined: Tue Dec 29, 2009 2:45 pm

Re: C++ code generation issues

Postby medvedm@zin-tech.com » Fri Jun 18, 2010 10:09 am

I think it has to do with static stuff, which it seems like your tool might not like:

viewtopic.php?f=28&t=1524&p=4166#p4166

M
medvedm@zin-tech.com
Forum Newbie
Forum Newbie
 
Posts: 9
Posts Rating:0
Joined: Tue Dec 29, 2009 2:45 pm

Re: C++ code generation issues

Postby bhoomchai » Wed Jun 23, 2010 9:21 pm

Check my reply in
https://community.nomagic.com/viewtopic.php?f=28&p=4166

When you generate the code the files in your working directory will be retrieved to be merged with the model.
bhoomchai
Customer Support
Customer Support
 
Posts: 36
Posts Rating:5
Joined: Thu Jan 21, 2010 12:38 am


Return to Code engineering

Who is online

Users browsing this forum: No registered users and 0 guests