Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.3
-
None
-
Any C++
-
Patch Available
Description
There are times when it would be beneficial to wrap Thrift-generated C++ classes with the SWIG tool (http://www.swig.org). This is a problem, though, because SWIG does not yet handle nested class or structure definitions and the C++ code generator defines the __isset structure within the scope of the class definition to which it pertains.
In order to make the Thrift-generated classes wrappable by SWIG, the __isset structure definition needs to be moved outside of the class definition. For a Thrift generated class called foo, the __isset definition would look like this:
typedef struct foo_isset {
foo_isset() : member0(false), member1(false) {}
bool member0;
bool member1;
} foo_isset;
and the using class would contain this line:
foo_isset __isset;
All existing code will continue to work, and can be regenerated at will.
I have a patch for this.