I am using, and want, both, forward(overwrite) and reverse(sync) directions, so your first two suggestions will not work. Forward(sync) is not used; the source code files produced by EA are intermediate/artifact items that are discarded after a build is completed.
For the third comment, you are correct, EA will not get Attributes from a .cpp file. I have to manually sync these. That really sucks, but what else can I do? However, the split files are not for getting the model to work, but to get my compilers to work. Let's call the part the has all the special stuff my Master file. It concatenates the model file to itself using an #include statement.
I have to wrap the model files with the Master files to handle the complexities of compiling and linking a class library that will support a range of real-time OS's, compilers and linkers. These complexities have syntax that EA does not forward/reverse-sync.
Where am I supposed to put these kinds of things (they can be unique for each/every model Element):
#pragma srcrelincludes on
#include "../language/MSL/lang.h"
#else
#include <msl_utility>
#endif
extern "C" void EnableInterrupts ();
#define MIDID(c1, c2, c3, c4) (ModuleId)( \
(((uint32)ModuleId_Cat1_ ##c1) << 24) | \
(((uint32)ModuleId_Cat2_ ##c2) << 16) | \
(((uint32)ModuleId_Cat3_ ##c3) <<

| \
(((uint32)ModuleId_Cat4_ ##c4) << 0) )
T class::var[] = { 1,2,3 };
[/font]
[/list]
EA strips these out but does not put them back in. So how do they get back in, to my project, not to my model?
Forward sync was the first thing I tried, but there were several problems with forward sync. I can't remember what they all were. One of them had to do with the difference between the code produced by forward sync and forward overwrite. For instance, I have modified the
AttributeDeclaration C++ template to do the initializer with this:
%if attInitial != "" and attStatic == "T" and attConst != "T"%
/* = %attInitial% */
%else%
%attInitial ? " = " value%
%endIf%If I
1) Add an new attribute to a class, in the .h file:
static int junk [] = {1,2,3};2) Do a reverse sync
then,
3) A forward sync, produces this:
static int junk [] = {1,2,3};4) A forward overwrite, produces this:
static int junk[] /* = {1,2,3} */;It seems as if my template customization is being ignored for a sync. I thought that was the way it was supposed to work. Perhaps not.