1
General Board / Forward code generation
« on: September 17, 2008, 10:42:53 pm »
Hello,
I'm coding in C++, and I want to develop an automatically generated 'Serialization' method.
The idea is that each member of the class will be generated into the function. Something like that (where 'm_a' and 'm_b' are properties stereotyped as 'Serializable') :
// Automatically generated function
void MyClass::Serialization()
{
SerMngr.Serialize(m_a);
SerMngr.Serialize(m_b);
}
I've writtent the templates, and my problem is that the function is only generated once.
If the coder adds another property to the class - it doesn't update the function.
Setting the 'Tools|Options|Source...|Replace(overwrite)' to true - is not an option because it will delete the other code in the class.
Does EA has a solution for this thing? Maybe something creative, like writing the 'Serialization' function into a different file, which will always be overwritten?
Thank you,
John.
I'm coding in C++, and I want to develop an automatically generated 'Serialization' method.
The idea is that each member of the class will be generated into the function. Something like that (where 'm_a' and 'm_b' are properties stereotyped as 'Serializable') :
// Automatically generated function
void MyClass::Serialization()
{
SerMngr.Serialize(m_a);
SerMngr.Serialize(m_b);
}
I've writtent the templates, and my problem is that the function is only generated once.
If the coder adds another property to the class - it doesn't update the function.
Setting the 'Tools|Options|Source...|Replace(overwrite)' to true - is not an option because it will delete the other code in the class.
Does EA has a solution for this thing? Maybe something creative, like writing the 'Serialization' function into a different file, which will always be overwritten?
Thank you,
John.