EA will not reverse engineer non-member functions.
Does the scripting engineer included in EA 7.5 Corporate or any other feature now provide a workaround? E.g., could I inject hooks on generation to have anonymous classes generate functions and other items? Is there a way to invoke a script on the reverse-engineering side?
I haven't really looked at metaprogramming, but as a guide, if it's recognizable as classes, then it's likely to be reverse engineered. Otherwise it's not.
The purpose would be to model them differently from plain old classes. Conceptually the classes are functions, the template parameters are function parameters, and specifying a class becomes a function call. Rather than just modeling them like template classes that have parameters, they could be better modeled as free functions, given an appropriate transformation. For example type information can be calculated at compile time:
// short-hands
struct true_type { static const bool value = true; };
struct false_type { static const bool value = false; };
template <typename T>
struct is_integral: public boost::false_type{}; // default
template <>
struct is_integral<int>: public boost::true_type; // partial specialization
struct is_integral<short>: public boost::true_type;
The naive representation is a bunch of classes.
A better representation is a set of free functions and constants with a stereotype to indicate they're template metafunctions, which would result in a different transformation.
It looks like EA 7.1 Professional allows some customization via generation templates. It does not appear to offer round-trip engineering. Would the new script customizations allow that?
Would there also be a way to improve parsing of C++ member data pointers, which cause an error in the code below?
struct Foo { int bar; }
void assign_foos_bar(int (Foo::*member), Foo & foo, int v) {
foo.*member = v;
}
void invoke {
Foo foo;
assign_foos_bar(&Foo::bar, foo, 42);
cout << foo.bar << endl; // prints 42
}
I realize these are the nether reaches of a 20 year-old programming language, but they're important things to model for a project of mine.
Thank you,
William La Cholter