// -*- c++ -*- // Copyright 2000, Karl Einar Nelson /* This is a generated file, do not edit. Generated from ../sigc++/macros/template.macros.m4 */ #ifndef SIGC_METHOD_SLOT #define SIGC_METHOD_SLOT #include #ifdef SIGC_CXX_NAMESPACES namespace SigC { #endif /**************************************************************/ // These are internal classes used to represent function varients of slots class Object; // (internal) struct LIBSIGC_API MethodSlotNode : public SlotNode { #ifdef _MSC_VER private: /** the sole purpose of this declaration is to introduce a new type that is guaranteed not to be related to any other type. (Ab)using class SigC::Object for this lead to some faulty conversions taking place with MSVC6. */ class GenericObject; typedef void* (GenericObject::*Method)(void*); public: #else typedef void* (Object::*Method)(void*); #endif Method method_; template MethodSlotNode(FuncPtr proxy,T2 method) : SlotNode(proxy) { init(reinterpret_cast(method)); } void init(Method method); virtual ~MethodSlotNode(); }; struct LIBSIGC_API ConstMethodSlotNode : public SlotNode { #ifdef _MSC_VER private: /** the sole purpose of this declaration is to introduce a new type that is guaranteed not to be related to any other type. (Ab)using class SigC::Object for this lead to some faulty conversions taking place with MSVC6. */ class GenericObject; typedef void* (GenericObject::*Method)(void*) const; public: #else typedef void* (Object::*Method)(void*) const; #endif Method method_; template ConstMethodSlotNode(FuncPtr proxy,T2 method) : SlotNode(proxy) { init(reinterpret_cast(method)); } void init(Method method); virtual ~ConstMethodSlotNode(); }; // These do not derive from MethodSlot, they merely are extended // ctor wrappers. They introduce how to deal with the proxy. template struct MethodSlot0_ { typedef typename Trait::type RType; static RType proxy(Obj& obj,void * s) { typedef RType (Obj::*Method)(); MethodSlotNode* os = (MethodSlotNode*)s; return ((Obj*)(&obj) ->*(reinterpret_cast(os->method_)))(); } }; template struct ConstMethodSlot0_ { typedef typename Trait::type RType; static RType proxy(Obj& obj,void * s) { typedef RType (Obj::*Method)() const; ConstMethodSlotNode* os = (ConstMethodSlotNode*)s; return ((Obj*)(&obj) ->*(reinterpret_cast(os->method_)))(); } }; template Slot1 slot(R (Obj::*method)()) { typedef MethodSlot0_ SType; return new MethodSlotNode((FuncPtr)(&SType::proxy), method); } template Slot1 slot(R (Obj::*method)() const) { typedef ConstMethodSlot0_ SType; return new ConstMethodSlotNode((FuncPtr)(&SType::proxy), method); } template struct MethodSlot1_ { typedef typename Trait::type RType; static RType proxy(Obj& obj,typename Trait::ref p1,void * s) { typedef RType (Obj::*Method)(P1); MethodSlotNode* os = (MethodSlotNode*)s; return ((Obj*)(&obj) ->*(reinterpret_cast(os->method_)))(p1); } }; template struct ConstMethodSlot1_ { typedef typename Trait::type RType; static RType proxy(Obj& obj,typename Trait::ref p1,void * s) { typedef RType (Obj::*Method)(P1) const; ConstMethodSlotNode* os = (ConstMethodSlotNode*)s; return ((Obj*)(&obj) ->*(reinterpret_cast(os->method_)))(p1); } }; template Slot2 slot(R (Obj::*method)(P1)) { typedef MethodSlot1_ SType; return new MethodSlotNode((FuncPtr)(&SType::proxy), method); } template Slot2 slot(R (Obj::*method)(P1) const) { typedef ConstMethodSlot1_ SType; return new ConstMethodSlotNode((FuncPtr)(&SType::proxy), method); } template struct MethodSlot2_ { typedef typename Trait::type RType; static RType proxy(Obj& obj,typename Trait::ref p1,typename Trait::ref p2,void * s) { typedef RType (Obj::*Method)(P1,P2); MethodSlotNode* os = (MethodSlotNode*)s; return ((Obj*)(&obj) ->*(reinterpret_cast(os->method_)))(p1,p2); } }; template struct ConstMethodSlot2_ { typedef typename Trait::type RType; static RType proxy(Obj& obj,typename Trait::ref p1,typename Trait::ref p2,void * s) { typedef RType (Obj::*Method)(P1,P2) const; ConstMethodSlotNode* os = (ConstMethodSlotNode*)s; return ((Obj*)(&obj) ->*(reinterpret_cast(os->method_)))(p1,p2); } }; template Slot3 slot(R (Obj::*method)(P1,P2)) { typedef MethodSlot2_ SType; return new MethodSlotNode((FuncPtr)(&SType::proxy), method); } template Slot3 slot(R (Obj::*method)(P1,P2) const) { typedef ConstMethodSlot2_ SType; return new ConstMethodSlotNode((FuncPtr)(&SType::proxy), method); } template struct MethodSlot3_ { typedef typename Trait::type RType; static RType proxy(Obj& obj,typename Trait::ref p1,typename Trait::ref p2,typename Trait::ref p3,void * s) { typedef RType (Obj::*Method)(P1,P2,P3); MethodSlotNode* os = (MethodSlotNode*)s; return ((Obj*)(&obj) ->*(reinterpret_cast(os->method_)))(p1,p2,p3); } }; template struct ConstMethodSlot3_ { typedef typename Trait::type RType; static RType proxy(Obj& obj,typename Trait::ref p1,typename Trait::ref p2,typename Trait::ref p3,void * s) { typedef RType (Obj::*Method)(P1,P2,P3) const; ConstMethodSlotNode* os = (ConstMethodSlotNode*)s; return ((Obj*)(&obj) ->*(reinterpret_cast(os->method_)))(p1,p2,p3); } }; template Slot4 slot(R (Obj::*method)(P1,P2,P3)) { typedef MethodSlot3_ SType; return new MethodSlotNode((FuncPtr)(&SType::proxy), method); } template Slot4 slot(R (Obj::*method)(P1,P2,P3) const) { typedef ConstMethodSlot3_ SType; return new ConstMethodSlotNode((FuncPtr)(&SType::proxy), method); } template struct MethodSlot4_ { typedef typename Trait::type RType; static RType proxy(Obj& obj,typename Trait::ref p1,typename Trait::ref p2,typename Trait::ref p3,typename Trait::ref p4,void * s) { typedef RType (Obj::*Method)(P1,P2,P3,P4); MethodSlotNode* os = (MethodSlotNode*)s; return ((Obj*)(&obj) ->*(reinterpret_cast(os->method_)))(p1,p2,p3,p4); } }; template struct ConstMethodSlot4_ { typedef typename Trait::type RType; static RType proxy(Obj& obj,typename Trait::ref p1,typename Trait::ref p2,typename Trait::ref p3,typename Trait::ref p4,void * s) { typedef RType (Obj::*Method)(P1,P2,P3,P4) const; ConstMethodSlotNode* os = (ConstMethodSlotNode*)s; return ((Obj*)(&obj) ->*(reinterpret_cast(os->method_)))(p1,p2,p3,p4); } }; template Slot5 slot(R (Obj::*method)(P1,P2,P3,P4)) { typedef MethodSlot4_ SType; return new MethodSlotNode((FuncPtr)(&SType::proxy), method); } template Slot5 slot(R (Obj::*method)(P1,P2,P3,P4) const) { typedef ConstMethodSlot4_ SType; return new ConstMethodSlotNode((FuncPtr)(&SType::proxy), method); } template struct MethodSlot5_ { typedef typename Trait::type RType; static RType proxy(Obj& obj,typename Trait::ref p1,typename Trait::ref p2,typename Trait::ref p3,typename Trait::ref p4,typename Trait::ref p5,void * s) { typedef RType (Obj::*Method)(P1,P2,P3,P4,P5); MethodSlotNode* os = (MethodSlotNode*)s; return ((Obj*)(&obj) ->*(reinterpret_cast(os->method_)))(p1,p2,p3,p4,p5); } }; template struct ConstMethodSlot5_ { typedef typename Trait::type RType; static RType proxy(Obj& obj,typename Trait::ref p1,typename Trait::ref p2,typename Trait::ref p3,typename Trait::ref p4,typename Trait::ref p5,void * s) { typedef RType (Obj::*Method)(P1,P2,P3,P4,P5) const; ConstMethodSlotNode* os = (ConstMethodSlotNode*)s; return ((Obj*)(&obj) ->*(reinterpret_cast(os->method_)))(p1,p2,p3,p4,p5); } }; template Slot6 slot(R (Obj::*method)(P1,P2,P3,P4,P5)) { typedef MethodSlot5_ SType; return new MethodSlotNode((FuncPtr)(&SType::proxy), method); } template Slot6 slot(R (Obj::*method)(P1,P2,P3,P4,P5) const) { typedef ConstMethodSlot5_ SType; return new ConstMethodSlotNode((FuncPtr)(&SType::proxy), method); } #ifdef SIGC_CXX_NAMESPACES } #endif #endif // SIGC_SLOT