#include #include using std::cout; using std::endl; class A { RQ_OBJECT("A") public: virtual ~A() { Destroyed(); } void emit() { Emit("emit()"); } //*SIGNAL* private: Int_t value; }; class B { RQ_OBJECT("B") public: B(A* ptr, const char *name = "") : a(ptr), fName(name) { a->Connect("emit()", "B", this, "doStuff()"); a->Connect("Destroyed()", "B", this, "KillMe()"); } virtual ~B() { a->Disconnect("emit()", this, "doStuff()"); a->Disconnect("Destroyed()", this, "KillMe()"); } void doStuff(){ cout << fName.Data() << ": Doing stuff" << endl; } void KillMe(){ cout << fName.Data() << ": Please kill me" << endl; } private: TString fName; A* a; };