On Wednesday 12 June 2002 09:20 am, David Faure wrote: > Hi Ashley, > > sorry for the slightly longer delay than usual, I was in Germany ;) No problem, just remember to give a "wow" or something at Germain's code.= :) > > I don't know how I lasted so long without a flags field in Smoke::Cla= ss. > > I need to know what classes have overridden virtual destructors, so I > > know when to expect destructor callbacks. Currently, I use isa("QObje= ct") > > || isa("QPaintDevice"). I would also like to know which classes have = copy > > constructors. I'll probably use another flag to mark classes which ar= e > > listed but not defined (like QWidget would be in SmokeKDE). > > > > David, can you add a flags field to smoke.h whenever Kalyptus generat= es > > it? > > > > + enum ClassFlags { > > +=09cf_constructor =3D 0x01,=09// has constructor > > +=09cf_deepcopy =3D 0x02,=09// has copy constructor > > +=09cf_virtual =3D 0x04,=09// has virtual destructor > > +=09cf_undefined =3D 0x10=09// defined elsewhere > > + }; > > Done. I made kalyptus set the cf_constructor and cf_deepcopy flags, fro= m > {CanBeInstanciated} and {CanBeCopied} ones. > What is cf_virtual good for? For sure I got rid of it in kalyptus itsel= f, > which means the generated code doesn't depend on whether there are > virtual methods or not (or specifically a virtual dtor). But I don't ha= ve > the full picture, if you say you need it I can easily add it ;) I need to know when I'll get a callback on object destruction. If Qt dele= tes=20 an object PerlQt created without a virtual destructor, I'll never know ab= out=20 it. There are two reasons. First, I have at least one global data structure w= hich=20 grows when (virtual) objects are created, the pointer =3D> object map. Wh= en=20 pointers are deleted, I need to delete the mappings or face a memory leak= =2E=20 Second, if I don't know whether an object is already deleted by Qt, I mig= ht=20 delete it again. Like I said above, I currently *guess* whether an object has a virtual=20 destructor depending on what class it inherits. I'd like it to be more=20 general than that. Perhaps knowing that QEvent has a virtual destructor w= ill=20 come in handy someday. *shrug* Ashley Winters