Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. // -*- c++ -*-
  2. /* This is a generated file, do not edit.  Generated from ../sigc++/macros/object_slot.h.m4 */
  3.  
  4. #ifndef SIGCXX_OBJECT_SLOT_H
  5. #define SIGCXX_OBJECT_SLOT_H
  6.  
  7. /*
  8.   SigC::slot() (obj)
  9.   -----------------------
  10.   slot() can be applied to a object method to form a Slot with a
  11.   profile equivelent to the method.  At the same time an instance
  12.   of that object must be specified.  The object must be derived
  13.   from SigC::Object.
  14.  
  15.   Sample usage:
  16.  
  17.     struct A: public SigC::Object
  18.       {
  19.        void foo(int,int);
  20.       } a;
  21.  
  22.     Slot2<void,int,int> s=slot(a,&A::foo);
  23.  
  24. */
  25.  
  26.  
  27. #include <sigc++/slot.h>
  28. #include <sigc++/scope.h>
  29.  
  30. #ifdef SIGC_CXX_NAMESPACES
  31. namespace SigC
  32. {
  33. #endif
  34.  
  35.  
  36.  
  37. /****************************************************************
  38. ***** Object Slot 0
  39. ****************************************************************/
  40. template <class R,class Obj>
  41. struct ObjectSlot0_
  42.   {
  43. #ifdef SIGC_CXX_PARTIAL_SPEC
  44.    typedef R RType;
  45. #else
  46.    typedef typename Trait<R>::type RType;
  47. #endif
  48.    typedef R     (Obj::*InFunc)();
  49.    typedef RType (Obj::*Func)();
  50.    typedef Slot0<R> SlotType;
  51.    typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
  52.  
  53.    static RType callback(void* d)
  54.      {
  55.       CallData* data=(CallData*)d;
  56.       return ((data->obj)->*(data->func))();
  57.      }
  58.  
  59.    static SlotData* create(Obj* obj,InFunc func)
  60.      {
  61.       if (!obj) return 0;
  62.       SlotData* tmp=manage(new SlotData());
  63.       CallData &data=reinterpret_cast<CallData&>(tmp->data_);
  64.       data.callback=&callback;
  65.       data.obj=obj;
  66.       data.func=(Func)func;
  67.       obj->register_data(tmp->receiver());
  68.       return tmp;
  69.      }
  70.   };
  71.  
  72.  
  73.  
  74. #ifndef SIGC_CXX_VOID_RETURN
  75. #ifdef SIGC_CXX_PARTIAL_SPEC
  76. template <class Obj>
  77. struct ObjectSlot0_<void,Obj>
  78.   {
  79.    typedef void RType;
  80.    typedef void     (Obj::*InFunc)();
  81.    typedef RType (Obj::*Func)();
  82.    typedef Slot0<void> SlotType;
  83.    typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
  84.  
  85.    static RType callback(void* d)
  86.      {
  87.       CallData* data=(CallData*)d;
  88.        ((data->obj)->*(data->func))();
  89.      }
  90.  
  91.    static SlotData* create(Obj* obj,InFunc func)
  92.      {
  93.       if (!obj) return 0;
  94.       SlotData* tmp=manage(new SlotData());
  95.       CallData &data=reinterpret_cast<CallData&>(tmp->data_);
  96.       data.callback=&callback;
  97.       data.obj=obj;
  98.       data.func=(Func)func;
  99.       obj->register_data(tmp->receiver());
  100.       return tmp;
  101.      }
  102.   };
  103.  
  104.  
  105. #endif
  106. #endif
  107.  
  108. template <class R,class O,class O2>
  109. inline Slot0<R>
  110.   slot(O* &obj,R (O2::*func)())
  111.   {
  112.     return ObjectSlot0_<R,O2>
  113.              ::create(obj,func);
  114.   }
  115.  
  116. template <class R,class O,class O2>
  117. inline Slot0<R>
  118.   slot(O* const &obj,R (O2::*func)())
  119.   {
  120.     return ObjectSlot0_<R,O2>
  121.              ::create(obj,func);
  122.   }
  123.  
  124. template <class R,class O,class O2>
  125. inline Slot0<R>
  126.   slot(O &obj,R (O2::*func)())
  127.   {
  128.     return ObjectSlot0_<R,O2>
  129.              ::create(&obj,func);
  130.   }
  131.  
  132.  
  133.  
  134. /****************************************************************
  135. ***** Object Slot 1
  136. ****************************************************************/
  137. template <class R,class P1,class Obj>
  138. struct ObjectSlot1_
  139.   {
  140. #ifdef SIGC_CXX_PARTIAL_SPEC
  141.    typedef R RType;
  142. #else
  143.    typedef typename Trait<R>::type RType;
  144. #endif
  145.    typedef R     (Obj::*InFunc)(P1);
  146.    typedef RType (Obj::*Func)(P1);
  147.    typedef Slot1<R,P1> SlotType;
  148.    typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
  149.  
  150.    static RType callback(void* d,P1 p1)
  151.      {
  152.       CallData* data=(CallData*)d;
  153.       return ((data->obj)->*(data->func))(p1);
  154.      }
  155.  
  156.    static SlotData* create(Obj* obj,InFunc func)
  157.      {
  158.       if (!obj) return 0;
  159.       SlotData* tmp=manage(new SlotData());
  160.       CallData &data=reinterpret_cast<CallData&>(tmp->data_);
  161.       data.callback=&callback;
  162.       data.obj=obj;
  163.       data.func=(Func)func;
  164.       obj->register_data(tmp->receiver());
  165.       return tmp;
  166.      }
  167.   };
  168.  
  169.  
  170.  
  171. #ifndef SIGC_CXX_VOID_RETURN
  172. #ifdef SIGC_CXX_PARTIAL_SPEC
  173. template <class P1,class Obj>
  174. struct ObjectSlot1_<void,P1,Obj>
  175.   {
  176.    typedef void RType;
  177.    typedef void     (Obj::*InFunc)(P1);
  178.    typedef RType (Obj::*Func)(P1);
  179.    typedef Slot1<void,P1> SlotType;
  180.    typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
  181.  
  182.    static RType callback(void* d,P1 p1)
  183.      {
  184.       CallData* data=(CallData*)d;
  185.        ((data->obj)->*(data->func))(p1);
  186.      }
  187.  
  188.    static SlotData* create(Obj* obj,InFunc func)
  189.      {
  190.       if (!obj) return 0;
  191.       SlotData* tmp=manage(new SlotData());
  192.       CallData &data=reinterpret_cast<CallData&>(tmp->data_);
  193.       data.callback=&callback;
  194.       data.obj=obj;
  195.       data.func=(Func)func;
  196.       obj->register_data(tmp->receiver());
  197.       return tmp;
  198.      }
  199.   };
  200.  
  201.  
  202. #endif
  203. #endif
  204.  
  205. template <class R,class P1,class O,class O2>
  206. inline Slot1<R,P1>
  207.   slot(O* &obj,R (O2::*func)(P1))
  208.   {
  209.     return ObjectSlot1_<R,P1,O2>
  210.              ::create(obj,func);
  211.   }
  212.  
  213. template <class R,class P1,class O,class O2>
  214. inline Slot1<R,P1>
  215.   slot(O* const &obj,R (O2::*func)(P1))
  216.   {
  217.     return ObjectSlot1_<R,P1,O2>
  218.              ::create(obj,func);
  219.   }
  220.  
  221. template <class R,class P1,class O,class O2>
  222. inline Slot1<R,P1>
  223.   slot(O &obj,R (O2::*func)(P1))
  224.   {
  225.     return ObjectSlot1_<R,P1,O2>
  226.              ::create(&obj,func);
  227.   }
  228.  
  229.  
  230.  
  231. /****************************************************************
  232. ***** Object Slot 2
  233. ****************************************************************/
  234. template <class R,class P1,class P2,class Obj>
  235. struct ObjectSlot2_
  236.   {
  237. #ifdef SIGC_CXX_PARTIAL_SPEC
  238.    typedef R RType;
  239. #else
  240.    typedef typename Trait<R>::type RType;
  241. #endif
  242.    typedef R     (Obj::*InFunc)(P1,P2);
  243.    typedef RType (Obj::*Func)(P1,P2);
  244.    typedef Slot2<R,P1,P2> SlotType;
  245.    typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
  246.  
  247.    static RType callback(void* d,P1 p1,P2 p2)
  248.      {
  249.       CallData* data=(CallData*)d;
  250.       return ((data->obj)->*(data->func))(p1,p2);
  251.      }
  252.  
  253.    static SlotData* create(Obj* obj,InFunc func)
  254.      {
  255.       if (!obj) return 0;
  256.       SlotData* tmp=manage(new SlotData());
  257.       CallData &data=reinterpret_cast<CallData&>(tmp->data_);
  258.       data.callback=&callback;
  259.       data.obj=obj;
  260.       data.func=(Func)func;
  261.       obj->register_data(tmp->receiver());
  262.       return tmp;
  263.      }
  264.   };
  265.  
  266.  
  267.  
  268. #ifndef SIGC_CXX_VOID_RETURN
  269. #ifdef SIGC_CXX_PARTIAL_SPEC
  270. template <class P1,class P2,class Obj>
  271. struct ObjectSlot2_<void,P1,P2,Obj>
  272.   {
  273.    typedef void RType;
  274.    typedef void     (Obj::*InFunc)(P1,P2);
  275.    typedef RType (Obj::*Func)(P1,P2);
  276.    typedef Slot2<void,P1,P2> SlotType;
  277.    typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
  278.  
  279.    static RType callback(void* d,P1 p1,P2 p2)
  280.      {
  281.       CallData* data=(CallData*)d;
  282.        ((data->obj)->*(data->func))(p1,p2);
  283.      }
  284.  
  285.    static SlotData* create(Obj* obj,InFunc func)
  286.      {
  287.       if (!obj) return 0;
  288.       SlotData* tmp=manage(new SlotData());
  289.       CallData &data=reinterpret_cast<CallData&>(tmp->data_);
  290.       data.callback=&callback;
  291.       data.obj=obj;
  292.       data.func=(Func)func;
  293.       obj->register_data(tmp->receiver());
  294.       return tmp;
  295.      }
  296.   };
  297.  
  298.  
  299. #endif
  300. #endif
  301.  
  302. template <class R,class P1,class P2,class O,class O2>
  303. inline Slot2<R,P1,P2>
  304.   slot(O* &obj,R (O2::*func)(P1,P2))
  305.   {
  306.     return ObjectSlot2_<R,P1,P2,O2>
  307.              ::create(obj,func);
  308.   }
  309.  
  310. template <class R,class P1,class P2,class O,class O2>
  311. inline Slot2<R,P1,P2>
  312.   slot(O* const &obj,R (O2::*func)(P1,P2))
  313.   {
  314.     return ObjectSlot2_<R,P1,P2,O2>
  315.              ::create(obj,func);
  316.   }
  317.  
  318. template <class R,class P1,class P2,class O,class O2>
  319. inline Slot2<R,P1,P2>
  320.   slot(O &obj,R (O2::*func)(P1,P2))
  321.   {
  322.     return ObjectSlot2_<R,P1,P2,O2>
  323.              ::create(&obj,func);
  324.   }
  325.  
  326.  
  327.  
  328. /****************************************************************
  329. ***** Object Slot 3
  330. ****************************************************************/
  331. template <class R,class P1,class P2,class P3,class Obj>
  332. struct ObjectSlot3_
  333.   {
  334. #ifdef SIGC_CXX_PARTIAL_SPEC
  335.    typedef R RType;
  336. #else
  337.    typedef typename Trait<R>::type RType;
  338. #endif
  339.    typedef R     (Obj::*InFunc)(P1,P2,P3);
  340.    typedef RType (Obj::*Func)(P1,P2,P3);
  341.    typedef Slot3<R,P1,P2,P3> SlotType;
  342.    typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
  343.  
  344.    static RType callback(void* d,P1 p1,P2 p2,P3 p3)
  345.      {
  346.       CallData* data=(CallData*)d;
  347.       return ((data->obj)->*(data->func))(p1,p2,p3);
  348.      }
  349.  
  350.    static SlotData* create(Obj* obj,InFunc func)
  351.      {
  352.       if (!obj) return 0;
  353.       SlotData* tmp=manage(new SlotData());
  354.       CallData &data=reinterpret_cast<CallData&>(tmp->data_);
  355.       data.callback=&callback;
  356.       data.obj=obj;
  357.       data.func=(Func)func;
  358.       obj->register_data(tmp->receiver());
  359.       return tmp;
  360.      }
  361.   };
  362.  
  363.  
  364.  
  365. #ifndef SIGC_CXX_VOID_RETURN
  366. #ifdef SIGC_CXX_PARTIAL_SPEC
  367. template <class P1,class P2,class P3,class Obj>
  368. struct ObjectSlot3_<void,P1,P2,P3,Obj>
  369.   {
  370.    typedef void RType;
  371.    typedef void     (Obj::*InFunc)(P1,P2,P3);
  372.    typedef RType (Obj::*Func)(P1,P2,P3);
  373.    typedef Slot3<void,P1,P2,P3> SlotType;
  374.    typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
  375.  
  376.    static RType callback(void* d,P1 p1,P2 p2,P3 p3)
  377.      {
  378.       CallData* data=(CallData*)d;
  379.        ((data->obj)->*(data->func))(p1,p2,p3);
  380.      }
  381.  
  382.    static SlotData* create(Obj* obj,InFunc func)
  383.      {
  384.       if (!obj) return 0;
  385.       SlotData* tmp=manage(new SlotData());
  386.       CallData &data=reinterpret_cast<CallData&>(tmp->data_);
  387.       data.callback=&callback;
  388.       data.obj=obj;
  389.       data.func=(Func)func;
  390.       obj->register_data(tmp->receiver());
  391.       return tmp;
  392.      }
  393.   };
  394.  
  395.  
  396. #endif
  397. #endif
  398.  
  399. template <class R,class P1,class P2,class P3,class O,class O2>
  400. inline Slot3<R,P1,P2,P3>
  401.   slot(O* &obj,R (O2::*func)(P1,P2,P3))
  402.   {
  403.     return ObjectSlot3_<R,P1,P2,P3,O2>
  404.              ::create(obj,func);
  405.   }
  406.  
  407. template <class R,class P1,class P2,class P3,class O,class O2>
  408. inline Slot3<R,P1,P2,P3>
  409.   slot(O* const &obj,R (O2::*func)(P1,P2,P3))
  410.   {
  411.     return ObjectSlot3_<R,P1,P2,P3,O2>
  412.              ::create(obj,func);
  413.   }
  414.  
  415. template <class R,class P1,class P2,class P3,class O,class O2>
  416. inline Slot3<R,P1,P2,P3>
  417.   slot(O &obj,R (O2::*func)(P1,P2,P3))
  418.   {
  419.     return ObjectSlot3_<R,P1,P2,P3,O2>
  420.              ::create(&obj,func);
  421.   }
  422.  
  423.  
  424.  
  425. /****************************************************************
  426. ***** Object Slot 4
  427. ****************************************************************/
  428. template <class R,class P1,class P2,class P3,class P4,class Obj>
  429. struct ObjectSlot4_
  430.   {
  431. #ifdef SIGC_CXX_PARTIAL_SPEC
  432.    typedef R RType;
  433. #else
  434.    typedef typename Trait<R>::type RType;
  435. #endif
  436.    typedef R     (Obj::*InFunc)(P1,P2,P3,P4);
  437.    typedef RType (Obj::*Func)(P1,P2,P3,P4);
  438.    typedef Slot4<R,P1,P2,P3,P4> SlotType;
  439.    typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
  440.  
  441.    static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4)
  442.      {
  443.       CallData* data=(CallData*)d;
  444.       return ((data->obj)->*(data->func))(p1,p2,p3,p4);
  445.      }
  446.  
  447.    static SlotData* create(Obj* obj,InFunc func)
  448.      {
  449.       if (!obj) return 0;
  450.       SlotData* tmp=manage(new SlotData());
  451.       CallData &data=reinterpret_cast<CallData&>(tmp->data_);
  452.       data.callback=&callback;
  453.       data.obj=obj;
  454.       data.func=(Func)func;
  455.       obj->register_data(tmp->receiver());
  456.       return tmp;
  457.      }
  458.   };
  459.  
  460.  
  461.  
  462. #ifndef SIGC_CXX_VOID_RETURN
  463. #ifdef SIGC_CXX_PARTIAL_SPEC
  464. template <class P1,class P2,class P3,class P4,class Obj>
  465. struct ObjectSlot4_<void,P1,P2,P3,P4,Obj>
  466.   {
  467.    typedef void RType;
  468.    typedef void     (Obj::*InFunc)(P1,P2,P3,P4);
  469.    typedef RType (Obj::*Func)(P1,P2,P3,P4);
  470.    typedef Slot4<void,P1,P2,P3,P4> SlotType;
  471.    typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
  472.  
  473.    static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4)
  474.      {
  475.       CallData* data=(CallData*)d;
  476.        ((data->obj)->*(data->func))(p1,p2,p3,p4);
  477.      }
  478.  
  479.    static SlotData* create(Obj* obj,InFunc func)
  480.      {
  481.       if (!obj) return 0;
  482.       SlotData* tmp=manage(new SlotData());
  483.       CallData &data=reinterpret_cast<CallData&>(tmp->data_);
  484.       data.callback=&callback;
  485.       data.obj=obj;
  486.       data.func=(Func)func;
  487.       obj->register_data(tmp->receiver());
  488.       return tmp;
  489.      }
  490.   };
  491.  
  492.  
  493. #endif
  494. #endif
  495.  
  496. template <class R,class P1,class P2,class P3,class P4,class O,class O2>
  497. inline Slot4<R,P1,P2,P3,P4>
  498.   slot(O* &obj,R (O2::*func)(P1,P2,P3,P4))
  499.   {
  500.     return ObjectSlot4_<R,P1,P2,P3,P4,O2>
  501.              ::create(obj,func);
  502.   }
  503.  
  504. template <class R,class P1,class P2,class P3,class P4,class O,class O2>
  505. inline Slot4<R,P1,P2,P3,P4>
  506.   slot(O* const &obj,R (O2::*func)(P1,P2,P3,P4))
  507.   {
  508.     return ObjectSlot4_<R,P1,P2,P3,P4,O2>
  509.              ::create(obj,func);
  510.   }
  511.  
  512. template <class R,class P1,class P2,class P3,class P4,class O,class O2>
  513. inline Slot4<R,P1,P2,P3,P4>
  514.   slot(O &obj,R (O2::*func)(P1,P2,P3,P4))
  515.   {
  516.     return ObjectSlot4_<R,P1,P2,P3,P4,O2>
  517.              ::create(&obj,func);
  518.   }
  519.  
  520.  
  521.  
  522. /****************************************************************
  523. ***** Object Slot 5
  524. ****************************************************************/
  525. template <class R,class P1,class P2,class P3,class P4,class P5,class Obj>
  526. struct ObjectSlot5_
  527.   {
  528. #ifdef SIGC_CXX_PARTIAL_SPEC
  529.    typedef R RType;
  530. #else
  531.    typedef typename Trait<R>::type RType;
  532. #endif
  533.    typedef R     (Obj::*InFunc)(P1,P2,P3,P4,P5);
  534.    typedef RType (Obj::*Func)(P1,P2,P3,P4,P5);
  535.    typedef Slot5<R,P1,P2,P3,P4,P5> SlotType;
  536.    typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
  537.  
  538.    static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5)
  539.      {
  540.       CallData* data=(CallData*)d;
  541.       return ((data->obj)->*(data->func))(p1,p2,p3,p4,p5);
  542.      }
  543.  
  544.    static SlotData* create(Obj* obj,InFunc func)
  545.      {
  546.       if (!obj) return 0;
  547.       SlotData* tmp=manage(new SlotData());
  548.       CallData &data=reinterpret_cast<CallData&>(tmp->data_);
  549.       data.callback=&callback;
  550.       data.obj=obj;
  551.       data.func=(Func)func;
  552.       obj->register_data(tmp->receiver());
  553.       return tmp;
  554.      }
  555.   };
  556.  
  557.  
  558.  
  559. #ifndef SIGC_CXX_VOID_RETURN
  560. #ifdef SIGC_CXX_PARTIAL_SPEC
  561. template <class P1,class P2,class P3,class P4,class P5,class Obj>
  562. struct ObjectSlot5_<void,P1,P2,P3,P4,P5,Obj>
  563.   {
  564.    typedef void RType;
  565.    typedef void     (Obj::*InFunc)(P1,P2,P3,P4,P5);
  566.    typedef RType (Obj::*Func)(P1,P2,P3,P4,P5);
  567.    typedef Slot5<void,P1,P2,P3,P4,P5> SlotType;
  568.    typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
  569.  
  570.    static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5)
  571.      {
  572.       CallData* data=(CallData*)d;
  573.        ((data->obj)->*(data->func))(p1,p2,p3,p4,p5);
  574.      }
  575.  
  576.    static SlotData* create(Obj* obj,InFunc func)
  577.      {
  578.       if (!obj) return 0;
  579.       SlotData* tmp=manage(new SlotData());
  580.       CallData &data=reinterpret_cast<CallData&>(tmp->data_);
  581.       data.callback=&callback;
  582.       data.obj=obj;
  583.       data.func=(Func)func;
  584.       obj->register_data(tmp->receiver());
  585.       return tmp;
  586.      }
  587.   };
  588.  
  589.  
  590. #endif
  591. #endif
  592.  
  593. template <class R,class P1,class P2,class P3,class P4,class P5,class O,class O2>
  594. inline Slot5<R,P1,P2,P3,P4,P5>
  595.   slot(O* &obj,R (O2::*func)(P1,P2,P3,P4,P5))
  596.   {
  597.     return ObjectSlot5_<R,P1,P2,P3,P4,P5,O2>
  598.              ::create(obj,func);
  599.   }
  600.  
  601. template <class R,class P1,class P2,class P3,class P4,class P5,class O,class O2>
  602. inline Slot5<R,P1,P2,P3,P4,P5>
  603.   slot(O* const &obj,R (O2::*func)(P1,P2,P3,P4,P5))
  604.   {
  605.     return ObjectSlot5_<R,P1,P2,P3,P4,P5,O2>
  606.              ::create(obj,func);
  607.   }
  608.  
  609. template <class R,class P1,class P2,class P3,class P4,class P5,class O,class O2>
  610. inline Slot5<R,P1,P2,P3,P4,P5>
  611.   slot(O &obj,R (O2::*func)(P1,P2,P3,P4,P5))
  612.   {
  613.     return ObjectSlot5_<R,P1,P2,P3,P4,P5,O2>
  614.              ::create(&obj,func);
  615.   }
  616.  
  617.  
  618.  
  619. /****************************************************************
  620. ***** Object Slot 6
  621. ****************************************************************/
  622. template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class Obj>
  623. struct ObjectSlot6_
  624.   {
  625. #ifdef SIGC_CXX_PARTIAL_SPEC
  626.    typedef R RType;
  627. #else
  628.    typedef typename Trait<R>::type RType;
  629. #endif
  630.    typedef R     (Obj::*InFunc)(P1,P2,P3,P4,P5,P6);
  631.    typedef RType (Obj::*Func)(P1,P2,P3,P4,P5,P6);
  632.    typedef Slot6<R,P1,P2,P3,P4,P5,P6> SlotType;
  633.    typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
  634.  
  635.    static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6)
  636.      {
  637.       CallData* data=(CallData*)d;
  638.       return ((data->obj)->*(data->func))(p1,p2,p3,p4,p5,p6);
  639.      }
  640.  
  641.    static SlotData* create(Obj* obj,InFunc func)
  642.      {
  643.       if (!obj) return 0;
  644.       SlotData* tmp=manage(new SlotData());
  645.       CallData &data=reinterpret_cast<CallData&>(tmp->data_);
  646.       data.callback=&callback;
  647.       data.obj=obj;
  648.       data.func=(Func)func;
  649.       obj->register_data(tmp->receiver());
  650.       return tmp;
  651.      }
  652.   };
  653.  
  654.  
  655.  
  656. #ifndef SIGC_CXX_VOID_RETURN
  657. #ifdef SIGC_CXX_PARTIAL_SPEC
  658. template <class P1,class P2,class P3,class P4,class P5,class P6,class Obj>
  659. struct ObjectSlot6_<void,P1,P2,P3,P4,P5,P6,Obj>
  660.   {
  661.    typedef void RType;
  662.    typedef void     (Obj::*InFunc)(P1,P2,P3,P4,P5,P6);
  663.    typedef RType (Obj::*Func)(P1,P2,P3,P4,P5,P6);
  664.    typedef Slot6<void,P1,P2,P3,P4,P5,P6> SlotType;
  665.    typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
  666.  
  667.    static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6)
  668.      {
  669.       CallData* data=(CallData*)d;
  670.        ((data->obj)->*(data->func))(p1,p2,p3,p4,p5,p6);
  671.      }
  672.  
  673.    static SlotData* create(Obj* obj,InFunc func)
  674.      {
  675.       if (!obj) return 0;
  676.       SlotData* tmp=manage(new SlotData());
  677.       CallData &data=reinterpret_cast<CallData&>(tmp->data_);
  678.       data.callback=&callback;
  679.       data.obj=obj;
  680.       data.func=(Func)func;
  681.       obj->register_data(tmp->receiver());
  682.       return tmp;
  683.      }
  684.   };
  685.  
  686.  
  687. #endif
  688. #endif
  689.  
  690. template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class O,class O2>
  691. inline Slot6<R,P1,P2,P3,P4,P5,P6>
  692.   slot(O* &obj,R (O2::*func)(P1,P2,P3,P4,P5,P6))
  693.   {
  694.     return ObjectSlot6_<R,P1,P2,P3,P4,P5,P6,O2>
  695.              ::create(obj,func);
  696.   }
  697.  
  698. template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class O,class O2>
  699. inline Slot6<R,P1,P2,P3,P4,P5,P6>
  700.   slot(O* const &obj,R (O2::*func)(P1,P2,P3,P4,P5,P6))
  701.   {
  702.     return ObjectSlot6_<R,P1,P2,P3,P4,P5,P6,O2>
  703.              ::create(obj,func);
  704.   }
  705.  
  706. template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class O,class O2>
  707. inline Slot6<R,P1,P2,P3,P4,P5,P6>
  708.   slot(O &obj,R (O2::*func)(P1,P2,P3,P4,P5,P6))
  709.   {
  710.     return ObjectSlot6_<R,P1,P2,P3,P4,P5,P6,O2>
  711.              ::create(&obj,func);
  712.   }
  713.  
  714.  
  715.  
  716. /****************************************************************
  717. ***** Object Slot 7
  718. ****************************************************************/
  719. template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class P7,class Obj>
  720. struct ObjectSlot7_
  721.   {
  722. #ifdef SIGC_CXX_PARTIAL_SPEC
  723.    typedef R RType;
  724. #else
  725.    typedef typename Trait<R>::type RType;
  726. #endif
  727.    typedef R     (Obj::*InFunc)(P1,P2,P3,P4,P5,P6,P7);
  728.    typedef RType (Obj::*Func)(P1,P2,P3,P4,P5,P6,P7);
  729.    typedef Slot7<R,P1,P2,P3,P4,P5,P6,P7> SlotType;
  730.    typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
  731.  
  732.    static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7)
  733.      {
  734.       CallData* data=(CallData*)d;
  735.       return ((data->obj)->*(data->func))(p1,p2,p3,p4,p5,p6,p7);
  736.      }
  737.  
  738.    static SlotData* create(Obj* obj,InFunc func)
  739.      {
  740.       if (!obj) return 0;
  741.       SlotData* tmp=manage(new SlotData());
  742.       CallData &data=reinterpret_cast<CallData&>(tmp->data_);
  743.       data.callback=&callback;
  744.       data.obj=obj;
  745.       data.func=(Func)func;
  746.       obj->register_data(tmp->receiver());
  747.       return tmp;
  748.      }
  749.   };
  750.  
  751.  
  752.  
  753. #ifndef SIGC_CXX_VOID_RETURN
  754. #ifdef SIGC_CXX_PARTIAL_SPEC
  755. template <class P1,class P2,class P3,class P4,class P5,class P6,class P7,class Obj>
  756. struct ObjectSlot7_<void,P1,P2,P3,P4,P5,P6,P7,Obj>
  757.   {
  758.    typedef void RType;
  759.    typedef void     (Obj::*InFunc)(P1,P2,P3,P4,P5,P6,P7);
  760.    typedef RType (Obj::*Func)(P1,P2,P3,P4,P5,P6,P7);
  761.    typedef Slot7<void,P1,P2,P3,P4,P5,P6,P7> SlotType;
  762.    typedef CallDataObj3<typename SlotType::Func,Obj,Func> CallData;
  763.  
  764.    static RType callback(void* d,P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7)
  765.      {
  766.       CallData* data=(CallData*)d;
  767.        ((data->obj)->*(data->func))(p1,p2,p3,p4,p5,p6,p7);
  768.      }
  769.  
  770.    static SlotData* create(Obj* obj,InFunc func)
  771.      {
  772.       if (!obj) return 0;
  773.       SlotData* tmp=manage(new SlotData());
  774.       CallData &data=reinterpret_cast<CallData&>(tmp->data_);
  775.       data.callback=&callback;
  776.       data.obj=obj;
  777.       data.func=(Func)func;
  778.       obj->register_data(tmp->receiver());
  779.       return tmp;
  780.      }
  781.   };
  782.  
  783.  
  784. #endif
  785. #endif
  786.  
  787. template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class P7,class O,class O2>
  788. inline Slot7<R,P1,P2,P3,P4,P5,P6,P7>
  789.   slot(O* &obj,R (O2::*func)(P1,P2,P3,P4,P5,P6,P7))
  790.   {
  791.     return ObjectSlot7_<R,P1,P2,P3,P4,P5,P6,P7,O2>
  792.              ::create(obj,func);
  793.   }
  794.  
  795. template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class P7,class O,class O2>
  796. inline Slot7<R,P1,P2,P3,P4,P5,P6,P7>
  797.   slot(O* const &obj,R (O2::*func)(P1,P2,P3,P4,P5,P6,P7))
  798.   {
  799.     return ObjectSlot7_<R,P1,P2,P3,P4,P5,P6,P7,O2>
  800.              ::create(obj,func);
  801.   }
  802.  
  803. template <class R,class P1,class P2,class P3,class P4,class P5,class P6,class P7,class O,class O2>
  804. inline Slot7<R,P1,P2,P3,P4,P5,P6,P7>
  805.   slot(O &obj,R (O2::*func)(P1,P2,P3,P4,P5,P6,P7))
  806.   {
  807.     return ObjectSlot7_<R,P1,P2,P3,P4,P5,P6,P7,O2>
  808.              ::create(&obj,func);
  809.   }
  810.  
  811.  
  812.  
  813.  
  814. #ifdef SIGC_CXX_NAMESPACES
  815. } // namespace
  816. #endif
  817.  
  818. #endif
  819.