// -*- c++ -*- /* This is a generated file, do not edit. Generated from ../sigc++/macros/object_slot.h.m4 */ #ifndef SIGCXX_OBJECT_SLOT_H #define SIGCXX_OBJECT_SLOT_H /* SigC::slot() (obj) ----------------------- slot() can be applied to a object method to form a Slot with a profile equivelent to the method. At the same time an instance of that object must be specified. The object must be derived from SigC::Object. Sample usage: struct A: public SigC::Object { void foo(int,int); } a; Slot2 s=slot(a,&A::foo); */ #include #include #ifdef SIGC_CXX_NAMESPACES namespace SigC { #endif /**************************************************************** ***** Object Slot 0 ****************************************************************/ template struct ObjectSlot0_ { #ifdef SIGC_CXX_PARTIAL_SPEC typedef R RType; #else typedef typename Trait::type RType; #endif typedef R (Obj::*InFunc)(); typedef RType (Obj::*Func)(); typedef Slot0 SlotType; typedef CallDataObj3 CallData; static RType callback(void* d) { CallData* data=(CallData*)d; return ((data->obj)->*(data->func))(); } 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; obj->register_data(tmp->receiver()); return tmp; } }; #ifndef SIGC_CXX_VOID_RETURN #ifdef SIGC_CXX_PARTIAL_SPEC template struct ObjectSlot0_ { typedef void RType; typedef void (Obj::*InFunc)(); typedef RType (Obj::*Func)(); typedef Slot0 SlotType; typedef CallDataObj3 CallData; static RType callback(void* d) { CallData* data=(CallData*)d; ((data->obj)->*(data->func))(); } 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; obj->register_data(tmp->receiver()); return tmp; } }; #endif #endif template inline Slot0 slot(O* &obj,R (O2::*func)()) { return ObjectSlot0_ ::create(obj,func); } template inline Slot0 slot(O* const &obj,R (O2::*func)()) { return ObjectSlot0_ ::create(obj,func); } template inline Slot0 slot(O &obj,R (O2::*func)()) { return ObjectSlot0_ ::create(&obj,func); } /**************************************************************** ***** Object Slot 1 ****************************************************************/ template struct ObjectSlot1_ { #ifdef SIGC_CXX_PARTIAL_SPEC typedef R RType; #else typedef typename Trait::type RType; #endif typedef R (Obj::*InFunc)(P1); typedef RType (Obj::*Func)(P1); typedef Slot1 SlotType; typedef CallDataObj3 CallData; static RType callback(void* d,P1 p1) { CallData* data=(CallData*)d; return ((data->obj)->*(data->func))(p1); } 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; obj->register_data(tmp->receiver()); return tmp; } }; #ifndef SIGC_CXX_VOID_RETURN #ifdef SIGC_CXX_PARTIAL_SPEC template struct ObjectSlot1_ { typedef void RType; typedef void (Obj::*InFunc)(P1); typedef RType (Obj::*Func)(P1); typedef Slot1 SlotType; typedef CallDataObj3 CallData; static RType callback(void* d,P1 p1) { CallData* data=(CallData*)d; ((data->obj)->*(data->func))(p1); } 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; obj->register_data(tmp->receiver()); return tmp; } }; #endif #endif template inline Slot1 slot(O* &obj,R (O2::*func)(P1)) { return ObjectSlot1_ ::create(obj,func); } template inline Slot1 slot(O* const &obj,R (O2::*func)(P1)) { return ObjectSlot1_ ::create(obj,func); } template inline Slot1 slot(O &obj,R (O2::*func)(P1)) { return ObjectSlot1_ ::create(&obj,func); } /**************************************************************** ***** Object Slot 2 ****************************************************************/ template struct ObjectSlot2_ { #ifdef SIGC_CXX_PARTIAL_SPEC typedef R RType; #else typedef typename Trait::type RType; #endif typedef R (Obj::*InFunc)(P1,P2); typedef RType (Obj::*Func)(P1,P2); typedef Slot2 SlotType; typedef CallDataObj3 CallData; static RType callback(void* d,P1 p1,P2 p2) { CallData* data=(CallData*)d; return ((data->obj)->*(data->func))(p1,p2); } 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; obj->register_data(tmp->receiver()); return tmp; } }; #ifndef SIGC_CXX_VOID_RETURN #ifdef SIGC_CXX_PARTIAL_SPEC template struct ObjectSlot2_ { typedef void RType; typedef void (Obj::*InFunc)(P1,P2); typedef RType (Obj::*Func)(P1,P2); typedef Slot2 SlotType; typedef CallDataObj3 CallData; static RType callback(void* d,P1 p1,P2 p2) { CallData* data=(CallData*)d; ((data->obj)->*(data->func))(p1,p2); } 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; obj->register_data(tmp->receiver()); return tmp; } }; #endif #endif template inline Slot2 slot(O* &obj,R (O2::*func)(P1,P2)) { return ObjectSlot2_ ::create(obj,func); } template inline Slot2 slot(O* const &obj,R (O2::*func)(P1,P2)) { return ObjectSlot2_ ::create(obj,func); } template inline Slot2 slot(O &obj,R (O2::*func)(P1,P2)) { return ObjectSlot2_ ::create(&obj,func); } /**************************************************************** ***** Object Slot 3 ****************************************************************/ template struct ObjectSlot3_ { #ifdef SIGC_CXX_PARTIAL_SPEC typedef R RType; #else typedef typename Trait::type RType; #endif typedef R (Obj::*InFunc)(P1,P2,P3); typedef RType (Obj::*Func)(P1,P2,P3); typedef Slot3 SlotType; typedef CallDataObj3 CallData; static RType callback(void* d,P1 p1,P2 p2,P3 p3) { CallData* data=(CallData*)d; return ((data->obj)->*(data->func))(p1,p2,p3); } 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; obj->register_data(tmp->receiver()); return tmp; } }; #ifndef SIGC_CXX_VOID_RETURN #ifdef SIGC_CXX_PARTIAL_SPEC template struct ObjectSlot3_ { typedef void RType; typedef void (Obj::*InFunc)(P1,P2,P3); typedef RType (Obj::*Func)(P1,P2,P3); typedef Slot3 SlotType; typedef CallDataObj3 CallData; static RType callback(void* d,P1 p1,P2 p2,P3 p3) { CallData* data=(CallData*)d; ((data->obj)->*(data->func))(p1,p2,p3); } 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; obj->register_data(tmp->receiver()); return tmp; } }; #endif #endif template inline Slot3 slot(O* &obj,R (O2::*func)(P1,P2,P3)) { return ObjectSlot3_ ::create(obj,func); } template inline Slot3 slot(O* const &obj,R (O2::*func)(P1,P2,P3)) { return ObjectSlot3_ ::create(obj,func); } template inline Slot3 slot(O &obj,R (O2::*func)(P1,P2,P3)) { return ObjectSlot3_ ::create(&obj,func); } /**************************************************************** ***** Object Slot 4 ****************************************************************/ template struct ObjectSlot4_ { #ifdef SIGC_CXX_PARTIAL_SPEC typedef R RType; #else typedef typename Trait::type RType; #endif typedef R (Obj::*InFunc)(P1,P2,P3,P4); typedef RType (Obj::*Func)(P1,P2,P3,P4); typedef Slot4 SlotType; typedef CallDataObj3 CallData; static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4) { CallData* data=(CallData*)d; return ((data->obj)->*(data->func))(p1,p2,p3,p4); } 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; obj->register_data(tmp->receiver()); return tmp; } }; #ifndef SIGC_CXX_VOID_RETURN #ifdef SIGC_CXX_PARTIAL_SPEC template struct ObjectSlot4_ { typedef void RType; typedef void (Obj::*InFunc)(P1,P2,P3,P4); typedef RType (Obj::*Func)(P1,P2,P3,P4); typedef Slot4 SlotType; typedef CallDataObj3 CallData; static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4) { CallData* data=(CallData*)d; ((data->obj)->*(data->func))(p1,p2,p3,p4); } 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; obj->register_data(tmp->receiver()); return tmp; } }; #endif #endif template inline Slot4 slot(O* &obj,R (O2::*func)(P1,P2,P3,P4)) { return ObjectSlot4_ ::create(obj,func); } template inline Slot4 slot(O* const &obj,R (O2::*func)(P1,P2,P3,P4)) { return ObjectSlot4_ ::create(obj,func); } template inline Slot4 slot(O &obj,R (O2::*func)(P1,P2,P3,P4)) { return ObjectSlot4_ ::create(&obj,func); } /**************************************************************** ***** Object Slot 5 ****************************************************************/ template struct ObjectSlot5_ { #ifdef SIGC_CXX_PARTIAL_SPEC typedef R RType; #else typedef typename Trait::type RType; #endif typedef R (Obj::*InFunc)(P1,P2,P3,P4,P5); typedef RType (Obj::*Func)(P1,P2,P3,P4,P5); typedef Slot5 SlotType; typedef CallDataObj3 CallData; static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5) { CallData* data=(CallData*)d; return ((data->obj)->*(data->func))(p1,p2,p3,p4,p5); } 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; obj->register_data(tmp->receiver()); return tmp; } }; #ifndef SIGC_CXX_VOID_RETURN #ifdef SIGC_CXX_PARTIAL_SPEC template struct ObjectSlot5_ { typedef void RType; typedef void (Obj::*InFunc)(P1,P2,P3,P4,P5); typedef RType (Obj::*Func)(P1,P2,P3,P4,P5); typedef Slot5 SlotType; typedef CallDataObj3 CallData; static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5) { CallData* data=(CallData*)d; ((data->obj)->*(data->func))(p1,p2,p3,p4,p5); } 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; obj->register_data(tmp->receiver()); return tmp; } }; #endif #endif template inline Slot5 slot(O* &obj,R (O2::*func)(P1,P2,P3,P4,P5)) { return ObjectSlot5_ ::create(obj,func); } template inline Slot5 slot(O* const &obj,R (O2::*func)(P1,P2,P3,P4,P5)) { return ObjectSlot5_ ::create(obj,func); } template inline Slot5 slot(O &obj,R (O2::*func)(P1,P2,P3,P4,P5)) { return ObjectSlot5_ ::create(&obj,func); } /**************************************************************** ***** Object Slot 6 ****************************************************************/ template struct ObjectSlot6_ { #ifdef SIGC_CXX_PARTIAL_SPEC typedef R RType; #else typedef typename Trait::type RType; #endif typedef R (Obj::*InFunc)(P1,P2,P3,P4,P5,P6); typedef RType (Obj::*Func)(P1,P2,P3,P4,P5,P6); typedef Slot6 SlotType; typedef CallDataObj3 CallData; static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6) { CallData* data=(CallData*)d; return ((data->obj)->*(data->func))(p1,p2,p3,p4,p5,p6); } 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; obj->register_data(tmp->receiver()); return tmp; } }; #ifndef SIGC_CXX_VOID_RETURN #ifdef SIGC_CXX_PARTIAL_SPEC template struct ObjectSlot6_ { typedef void RType; typedef void (Obj::*InFunc)(P1,P2,P3,P4,P5,P6); typedef RType (Obj::*Func)(P1,P2,P3,P4,P5,P6); typedef Slot6 SlotType; typedef CallDataObj3 CallData; static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6) { CallData* data=(CallData*)d; ((data->obj)->*(data->func))(p1,p2,p3,p4,p5,p6); } 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; obj->register_data(tmp->receiver()); return tmp; } }; #endif #endif template inline Slot6 slot(O* &obj,R (O2::*func)(P1,P2,P3,P4,P5,P6)) { return ObjectSlot6_ ::create(obj,func); } template inline Slot6 slot(O* const &obj,R (O2::*func)(P1,P2,P3,P4,P5,P6)) { return ObjectSlot6_ ::create(obj,func); } template inline Slot6 slot(O &obj,R (O2::*func)(P1,P2,P3,P4,P5,P6)) { return ObjectSlot6_ ::create(&obj,func); } /**************************************************************** ***** Object Slot 7 ****************************************************************/ template struct ObjectSlot7_ { #ifdef SIGC_CXX_PARTIAL_SPEC typedef R RType; #else typedef typename Trait::type RType; #endif typedef R (Obj::*InFunc)(P1,P2,P3,P4,P5,P6,P7); typedef RType (Obj::*Func)(P1,P2,P3,P4,P5,P6,P7); typedef Slot7 SlotType; typedef CallDataObj3 CallData; static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7) { CallData* data=(CallData*)d; return ((data->obj)->*(data->func))(p1,p2,p3,p4,p5,p6,p7); } 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; obj->register_data(tmp->receiver()); return tmp; } }; #ifndef SIGC_CXX_VOID_RETURN #ifdef SIGC_CXX_PARTIAL_SPEC template struct ObjectSlot7_ { typedef void RType; typedef void (Obj::*InFunc)(P1,P2,P3,P4,P5,P6,P7); typedef RType (Obj::*Func)(P1,P2,P3,P4,P5,P6,P7); typedef Slot7 SlotType; typedef CallDataObj3 CallData; static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7) { CallData* data=(CallData*)d; ((data->obj)->*(data->func))(p1,p2,p3,p4,p5,p6,p7); } 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; obj->register_data(tmp->receiver()); return tmp; } }; #endif #endif template inline Slot7 slot(O* &obj,R (O2::*func)(P1,P2,P3,P4,P5,P6,P7)) { return ObjectSlot7_ ::create(obj,func); } template inline Slot7 slot(O* const &obj,R (O2::*func)(P1,P2,P3,P4,P5,P6,P7)) { return ObjectSlot7_ ::create(obj,func); } template inline Slot7 slot(O &obj,R (O2::*func)(P1,P2,P3,P4,P5,P6,P7)) { return ObjectSlot7_ ::create(&obj,func); } #ifdef SIGC_CXX_NAMESPACES } // namespace #endif #endif