// -*- c++ -*- /* This is a generated file, do not edit. Generated from ../sigc++/macros/class_slot.h.m4 */ #ifndef SIGCXX_CLASS_SLOT_H #define SIGCXX_CLASS_SLOT_H /* SigC::slot_class() (class) ----------------------- slot_class() can be applied to a class method to form a Slot with a profile equivelent to the method. At the same time an instance of that class must be specified. This is an unsafe interface. This does NOT require that the class be derived from SigC::Object. However, the object should be static with regards to the signal system. (allocated within the global scope.) If it is not and a connected slot is call it will result in a seg fault. If the object must be destroyed before the connected slots, all connections must be disconnected by hand. Sample usage: struct A { void foo(int,int); } a; Slot2 s=slot_class(a,&A::foo); */ #include #ifdef SIGC_CXX_NAMESPACES namespace SigC { #endif /**************************************************************** ***** Class Slot 0 ****************************************************************/ template struct ClassSlot0_:public ObjectSlot0_ { typedef ObjectSlot0_ Base; typedef typename Base::InFunc InFunc; static SlotData* create(Obj* obj,InFunc func) { if (!obj) return 0; SlotData* tmp=manage(new SlotData()); CallData &data=reinterpret_cast(tmp->data_); data.callback=&callback; data.obj=obj; data.func=(Func)func; return tmp; } }; template Slot0 slot_class(Obj &obj,R (Obj::*func)()) {return ClassSlot0_::create(&obj,func); } template Slot0 slot_class(Obj *obj,R (Obj::*func)()) {return ClassSlot0_::create(obj,func); } /**************************************************************** ***** Class Slot 1 ****************************************************************/ template struct ClassSlot1_:public ObjectSlot1_ { typedef ObjectSlot1_ Base; typedef typename Base::InFunc InFunc; static SlotData* create(Obj* obj,InFunc func) { if (!obj) return 0; SlotData* tmp=manage(new SlotData()); CallData &data=reinterpret_cast(tmp->data_); data.callback=&callback; data.obj=obj; data.func=(Func)func; return tmp; } }; template Slot1 slot_class(Obj &obj,R (Obj::*func)(P1)) {return ClassSlot1_::create(&obj,func); } template Slot1 slot_class(Obj *obj,R (Obj::*func)(P1)) {return ClassSlot1_::create(obj,func); } /**************************************************************** ***** Class Slot 2 ****************************************************************/ template struct ClassSlot2_:public ObjectSlot2_ { typedef ObjectSlot2_ Base; typedef typename Base::InFunc InFunc; static SlotData* create(Obj* obj,InFunc func) { if (!obj) return 0; SlotData* tmp=manage(new SlotData()); CallData &data=reinterpret_cast(tmp->data_); data.callback=&callback; data.obj=obj; data.func=(Func)func; return tmp; } }; template Slot2 slot_class(Obj &obj,R (Obj::*func)(P1,P2)) {return ClassSlot2_::create(&obj,func); } template Slot2 slot_class(Obj *obj,R (Obj::*func)(P1,P2)) {return ClassSlot2_::create(obj,func); } /**************************************************************** ***** Class Slot 3 ****************************************************************/ template struct ClassSlot3_:public ObjectSlot3_ { typedef ObjectSlot3_ Base; typedef typename Base::InFunc InFunc; static SlotData* create(Obj* obj,InFunc func) { if (!obj) return 0; SlotData* tmp=manage(new SlotData()); CallData &data=reinterpret_cast(tmp->data_); data.callback=&callback; data.obj=obj; data.func=(Func)func; return tmp; } }; template Slot3 slot_class(Obj &obj,R (Obj::*func)(P1,P2,P3)) {return ClassSlot3_::create(&obj,func); } template Slot3 slot_class(Obj *obj,R (Obj::*func)(P1,P2,P3)) {return ClassSlot3_::create(obj,func); } /**************************************************************** ***** Class Slot 4 ****************************************************************/ template struct ClassSlot4_:public ObjectSlot4_ { typedef ObjectSlot4_ Base; typedef typename Base::InFunc InFunc; static SlotData* create(Obj* obj,InFunc func) { if (!obj) return 0; SlotData* tmp=manage(new SlotData()); CallData &data=reinterpret_cast(tmp->data_); data.callback=&callback; data.obj=obj; data.func=(Func)func; return tmp; } }; template Slot4 slot_class(Obj &obj,R (Obj::*func)(P1,P2,P3,P4)) {return ClassSlot4_::create(&obj,func); } template Slot4 slot_class(Obj *obj,R (Obj::*func)(P1,P2,P3,P4)) {return ClassSlot4_::create(obj,func); } /**************************************************************** ***** Class Slot 5 ****************************************************************/ template struct ClassSlot5_:public ObjectSlot5_ { typedef ObjectSlot5_ Base; typedef typename Base::InFunc InFunc; static SlotData* create(Obj* obj,InFunc func) { if (!obj) return 0; SlotData* tmp=manage(new SlotData()); CallData &data=reinterpret_cast(tmp->data_); data.callback=&callback; data.obj=obj; data.func=(Func)func; return tmp; } }; template Slot5 slot_class(Obj &obj,R (Obj::*func)(P1,P2,P3,P4,P5)) {return ClassSlot5_::create(&obj,func); } template Slot5 slot_class(Obj *obj,R (Obj::*func)(P1,P2,P3,P4,P5)) {return ClassSlot5_::create(obj,func); } /**************************************************************** ***** Class Slot 6 ****************************************************************/ template struct ClassSlot6_:public ObjectSlot6_ { typedef ObjectSlot6_ Base; typedef typename Base::InFunc InFunc; static SlotData* create(Obj* obj,InFunc func) { if (!obj) return 0; SlotData* tmp=manage(new SlotData()); CallData &data=reinterpret_cast(tmp->data_); data.callback=&callback; data.obj=obj; data.func=(Func)func; return tmp; } }; template Slot6 slot_class(Obj &obj,R (Obj::*func)(P1,P2,P3,P4,P5,P6)) {return ClassSlot6_::create(&obj,func); } template Slot6 slot_class(Obj *obj,R (Obj::*func)(P1,P2,P3,P4,P5,P6)) {return ClassSlot6_::create(obj,func); } /**************************************************************** ***** Class Slot 7 ****************************************************************/ template struct ClassSlot7_:public ObjectSlot7_ { typedef ObjectSlot7_ Base; typedef typename Base::InFunc InFunc; static SlotData* create(Obj* obj,InFunc func) { if (!obj) return 0; SlotData* tmp=manage(new SlotData()); CallData &data=reinterpret_cast(tmp->data_); data.callback=&callback; data.obj=obj; data.func=(Func)func; return tmp; } }; template Slot7 slot_class(Obj &obj,R (Obj::*func)(P1,P2,P3,P4,P5,P6,P7)) {return ClassSlot7_::create(&obj,func); } template Slot7 slot_class(Obj *obj,R (Obj::*func)(P1,P2,P3,P4,P5,P6,P7)) {return ClassSlot7_::create(obj,func); } #ifdef SIGC_CXX_NAMESPACES } // namespace #endif #endif