Martin Thank you for bringing this to the community, please see http://thrift.apache.org/docs/HowToContribute/ for instructions on contribution back patches like this.
-Jake On Fri, Sep 28, 2012 at 12:53 PM, Martin Vogt <mvo...@gmail.com> wrote: > 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 >