// -*- c++ -*- /* This is a generated file, do not edit. Generated from ../sigc++/macros/func_slot.h.m4 */ #ifndef SIGCXX_FUNC_SLOT_H #define SIGCXX_FUNC_SLOT_H #include /* SigC::slot() (function) ----------------------- slot() can be applied to a function to form a Slot with a profile equivelent to the function. To avoid warns be sure to pass the address of the function. Sample usage: void foo(int,int); Slot2 s=slot(&foo); */ #ifdef SIGC_CXX_NAMESPACES namespace SigC { #endif // From which we build specific Slots and a set of // functions for creating a slot of this type /**************************************************************** ***** Function Slot 0 ****************************************************************/ template struct FuncSlot0_ { #ifdef SIGC_CXX_PARTIAL_SPEC typedef R RType; #else typedef typename Trait::type RType; #endif typedef R (*InFunc)(); typedef RType (*Func)(); typedef Slot0 SlotType; typedef CallDataFunc CallData; static RType callback(void* data) { return (((CallData*)data)->func)(); } static SlotData* create(InFunc func) { SlotData* tmp=manage(new SlotData()); CallData &data=reinterpret_cast(tmp->data_); data.callback=&callback; data.func=(Func)func; return tmp; } }; #ifndef SIGC_CXX_VOID_RETURN #ifdef SIGC_CXX_PARTIAL_SPEC template <> struct FuncSlot0_ { typedef void RType; typedef void (*InFunc)(); typedef RType (*Func)(); typedef Slot0 SlotType; typedef CallDataFunc CallData; static RType callback(void* data) { (((CallData*)data)->func)(); } static SlotData* create(InFunc func) { SlotData* tmp=manage(new SlotData()); CallData &data=reinterpret_cast(tmp->data_); data.callback=&callback; data.func=(Func)func; return tmp; } }; #endif #endif template inline Slot0 slot(R (*func)()) { return FuncSlot0_::create(func); } /**************************************************************** ***** Function Slot 1 ****************************************************************/ template struct FuncSlot1_ { #ifdef SIGC_CXX_PARTIAL_SPEC typedef R RType; #else typedef typename Trait::type RType; #endif typedef R (*InFunc)(P1); typedef RType (*Func)(P1); typedef Slot1 SlotType; typedef CallDataFunc CallData; static RType callback(void* data,P1 p1) { return (((CallData*)data)->func)(p1); } static SlotData* create(InFunc func) { SlotData* tmp=manage(new SlotData()); CallData &data=reinterpret_cast(tmp->data_); data.callback=&callback; data.func=(Func)func; return tmp; } }; #ifndef SIGC_CXX_VOID_RETURN #ifdef SIGC_CXX_PARTIAL_SPEC template struct FuncSlot1_ { typedef void RType; typedef void (*InFunc)(P1); typedef RType (*Func)(P1); typedef Slot1 SlotType; typedef CallDataFunc CallData; static RType callback(void* data,P1 p1) { (((CallData*)data)->func)(p1); } static SlotData* create(InFunc func) { SlotData* tmp=manage(new SlotData()); CallData &data=reinterpret_cast(tmp->data_); data.callback=&callback; data.func=(Func)func; return tmp; } }; #endif #endif template inline Slot1 slot(R (*func)(P1)) { return FuncSlot1_::create(func); } /**************************************************************** ***** Function Slot 2 ****************************************************************/ template struct FuncSlot2_ { #ifdef SIGC_CXX_PARTIAL_SPEC typedef R RType; #else typedef typename Trait::type RType; #endif typedef R (*InFunc)(P1,P2); typedef RType (*Func)(P1,P2); typedef Slot2 SlotType; typedef CallDataFunc CallData; static RType callback(void* data,P1 p1,P2 p2) { return (((CallData*)data)->func)(p1,p2); } static SlotData* create(InFunc func) { SlotData* tmp=manage(new SlotData()); CallData &data=reinterpret_cast(tmp->data_); data.callback=&callback; data.func=(Func)func; return tmp; } }; #ifndef SIGC_CXX_VOID_RETURN #ifdef SIGC_CXX_PARTIAL_SPEC template struct FuncSlot2_ { typedef void RType; typedef void (*InFunc)(P1,P2); typedef RType (*Func)(P1,P2); typedef Slot2 SlotType; typedef CallDataFunc CallData; static RType callback(void* data,P1 p1,P2 p2) { (((CallData*)data)->func)(p1,p2); } static SlotData* create(InFunc func) { SlotData* tmp=manage(new SlotData()); CallData &data=reinterpret_cast(tmp->data_); data.callback=&callback; data.func=(Func)func; return tmp; } }; #endif #endif template inline Slot2 slot(R (*func)(P1,P2)) { return FuncSlot2_::create(func); } /**************************************************************** ***** Function Slot 3 ****************************************************************/ template struct FuncSlot3_ { #ifdef SIGC_CXX_PARTIAL_SPEC typedef R RType; #else typedef typename Trait::type RType; #endif typedef R (*InFunc)(P1,P2,P3); typedef RType (*Func)(P1,P2,P3); typedef Slot3 SlotType; typedef CallDataFunc CallData; static RType callback(void* data,P1 p1,P2 p2,P3 p3) { return (((CallData*)data)->func)(p1,p2,p3); } static SlotData* create(InFunc func) { SlotData* tmp=manage(new SlotData()); CallData &data=reinterpret_cast(tmp->data_); data.callback=&callback; data.func=(Func)func; return tmp; } }; #ifndef SIGC_CXX_VOID_RETURN #ifdef SIGC_CXX_PARTIAL_SPEC template struct FuncSlot3_ { typedef void RType; typedef void (*InFunc)(P1,P2,P3); typedef RType (*Func)(P1,P2,P3); typedef Slot3 SlotType; typedef CallDataFunc CallData; static RType callback(void* data,P1 p1,P2 p2,P3 p3) { (((CallData*)data)->func)(p1,p2,p3); } static SlotData* create(InFunc func) { SlotData* tmp=manage(new SlotData()); CallData &data=reinterpret_cast(tmp->data_); data.callback=&callback; data.func=(Func)func; return tmp; } }; #endif #endif template inline Slot3 slot(R (*func)(P1,P2,P3)) { return FuncSlot3_::create(func); } /**************************************************************** ***** Function Slot 4 ****************************************************************/ template struct FuncSlot4_ { #ifdef SIGC_CXX_PARTIAL_SPEC typedef R RType; #else typedef typename Trait::type RType; #endif typedef R (*InFunc)(P1,P2,P3,P4); typedef RType (*Func)(P1,P2,P3,P4); typedef Slot4 SlotType; typedef CallDataFunc CallData; static RType callback(void* data,P1 p1,P2 p2,P3 p3,P4 p4) { return (((CallData*)data)->func)(p1,p2,p3,p4); } static SlotData* create(InFunc func) { SlotData* tmp=manage(new SlotData()); CallData &data=reinterpret_cast(tmp->data_); data.callback=&callback; data.func=(Func)func; return tmp; } }; #ifndef SIGC_CXX_VOID_RETURN #ifdef SIGC_CXX_PARTIAL_SPEC template struct FuncSlot4_ { typedef void RType; typedef void (*InFunc)(P1,P2,P3,P4); typedef RType (*Func)(P1,P2,P3,P4); typedef Slot4 SlotType; typedef CallDataFunc CallData; static RType callback(void* data,P1 p1,P2 p2,P3 p3,P4 p4) { (((CallData*)data)->func)(p1,p2,p3,p4); } static SlotData* create(InFunc func) { SlotData* tmp=manage(new SlotData()); CallData &data=reinterpret_cast(tmp->data_); data.callback=&callback; data.func=(Func)func; return tmp; } }; #endif #endif template inline Slot4 slot(R (*func)(P1,P2,P3,P4)) { return FuncSlot4_::create(func); } /**************************************************************** ***** Function Slot 5 ****************************************************************/ template struct FuncSlot5_ { #ifdef SIGC_CXX_PARTIAL_SPEC typedef R RType; #else typedef typename Trait::type RType; #endif typedef R (*InFunc)(P1,P2,P3,P4,P5); typedef RType (*Func)(P1,P2,P3,P4,P5); typedef Slot5 SlotType; typedef CallDataFunc CallData; static RType callback(void* data,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5) { return (((CallData*)data)->func)(p1,p2,p3,p4,p5); } static SlotData* create(InFunc func) { SlotData* tmp=manage(new SlotData()); CallData &data=reinterpret_cast(tmp->data_); data.callback=&callback; data.func=(Func)func; return tmp; } }; #ifndef SIGC_CXX_VOID_RETURN #ifdef SIGC_CXX_PARTIAL_SPEC template struct FuncSlot5_ { typedef void RType; typedef void (*InFunc)(P1,P2,P3,P4,P5); typedef RType (*Func)(P1,P2,P3,P4,P5); typedef Slot5 SlotType; typedef CallDataFunc CallData; static RType callback(void* data,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5) { (((CallData*)data)->func)(p1,p2,p3,p4,p5); } static SlotData* create(InFunc func) { SlotData* tmp=manage(new SlotData()); CallData &data=reinterpret_cast(tmp->data_); data.callback=&callback; data.func=(Func)func; return tmp; } }; #endif #endif template inline Slot5 slot(R (*func)(P1,P2,P3,P4,P5)) { return FuncSlot5_::create(func); } /**************************************************************** ***** Function Slot 6 ****************************************************************/ template struct FuncSlot6_ { #ifdef SIGC_CXX_PARTIAL_SPEC typedef R RType; #else typedef typename Trait::type RType; #endif typedef R (*InFunc)(P1,P2,P3,P4,P5,P6); typedef RType (*Func)(P1,P2,P3,P4,P5,P6); typedef Slot6 SlotType; typedef CallDataFunc CallData; static RType callback(void* data,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6) { return (((CallData*)data)->func)(p1,p2,p3,p4,p5,p6); } static SlotData* create(InFunc func) { SlotData* tmp=manage(new SlotData()); CallData &data=reinterpret_cast(tmp->data_); data.callback=&callback; data.func=(Func)func; return tmp; } }; #ifndef SIGC_CXX_VOID_RETURN #ifdef SIGC_CXX_PARTIAL_SPEC template struct FuncSlot6_ { typedef void RType; typedef void (*InFunc)(P1,P2,P3,P4,P5,P6); typedef RType (*Func)(P1,P2,P3,P4,P5,P6); typedef Slot6 SlotType; typedef CallDataFunc CallData; static RType callback(void* data,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6) { (((CallData*)data)->func)(p1,p2,p3,p4,p5,p6); } static SlotData* create(InFunc func) { SlotData* tmp=manage(new SlotData()); CallData &data=reinterpret_cast(tmp->data_); data.callback=&callback; data.func=(Func)func; return tmp; } }; #endif #endif template inline Slot6 slot(R (*func)(P1,P2,P3,P4,P5,P6)) { return FuncSlot6_::create(func); } /**************************************************************** ***** Function Slot 7 ****************************************************************/ template struct FuncSlot7_ { #ifdef SIGC_CXX_PARTIAL_SPEC typedef R RType; #else typedef typename Trait::type RType; #endif typedef R (*InFunc)(P1,P2,P3,P4,P5,P6,P7); typedef RType (*Func)(P1,P2,P3,P4,P5,P6,P7); typedef Slot7 SlotType; typedef CallDataFunc CallData; static RType callback(void* data,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7) { return (((CallData*)data)->func)(p1,p2,p3,p4,p5,p6,p7); } static SlotData* create(InFunc func) { SlotData* tmp=manage(new SlotData()); CallData &data=reinterpret_cast(tmp->data_); data.callback=&callback; data.func=(Func)func; return tmp; } }; #ifndef SIGC_CXX_VOID_RETURN #ifdef SIGC_CXX_PARTIAL_SPEC template struct FuncSlot7_ { typedef void RType; typedef void (*InFunc)(P1,P2,P3,P4,P5,P6,P7); typedef RType (*Func)(P1,P2,P3,P4,P5,P6,P7); typedef Slot7 SlotType; typedef CallDataFunc CallData; static RType callback(void* data,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7) { (((CallData*)data)->func)(p1,p2,p3,p4,p5,p6,p7); } static SlotData* create(InFunc func) { SlotData* tmp=manage(new SlotData()); CallData &data=reinterpret_cast(tmp->data_); data.callback=&callback; data.func=(Func)func; return tmp; } }; #endif #endif template inline Slot7 slot(R (*func)(P1,P2,P3,P4,P5,P6,P7)) { return FuncSlot7_::create(func); } #ifdef SIGC_CXX_NAMESPACES } // namespace #endif #endif // SIGCXX_FUNC_SLOT_H