Hello,

I would like to use the c++ generator for structs
in a QT application with signal/slots.

For example:

thrift:
struct Matrix
{
  1: required i64 rows=123,
  2:i64 cols,
  3:list<Vector> data,
}

QT class:
emit(mySignal(TBase*))

where TBase is a common base class for the generated
struct/class Matrix.

Then some receiver can check if the class which
they receive like this:

QT Slot:
void myMatrixSlot(TBase* tBase) [
 if (tBase->compare(Matrix::ascii_fingerprint)==0) {
   Matrix* matrix=(Matrix*)tBase;
   // work with matrix
   //
 }
}

The problem is that the current cpp generator does not generate
such a base class. The attached patch is a first modification
which I used for my tests.

Is it possible to add such a baseclass extension into
the thrift repository?

regards,

Martin

Reply via email to