// -*- c++ -*- /* This is a generated file, do not edit. Generated from template.macros.m4 */ #ifndef SIGC_CONVERT_H #define SIGC_CONVERT_H #include /* SigC::convert ------------- convert() alters a Slot by assigning a conversion function which can completely alter the parameter types of a slot. Only convert functions for changing with same number of arguments is compiled by default. Sample usage: int my_string_to_char(Slot2 &d,const string &s) int f(const char*); string s=hello; Slot1 s2=convert(slot(&f),my_string_to_char); s2(s); */ #ifdef SIGC_CXX_NAMESPACES namespace SigCX { #endif // (internal) struct AdaptorConvertSlotNode : public SigC::AdaptorSlotNode { SigC::FuncPtr convert_func_; AdaptorConvertSlotNode(SigC::FuncPtr proxy, const SigC::Node& s, SigC::FuncPtr dtor); virtual ~AdaptorConvertSlotNode(); }; template struct AdaptorConvertSlot0_ { typedef typename SigC::Trait::type RType; typedef R (*ConvertFunc)(T&); static RType proxy(void *data) { AdaptorConvertSlotNode& node=*(AdaptorConvertSlotNode*)(data); T &slot_=(T&)(node.slot_); return ((ConvertFunc)(node.convert_func_)) (slot_); } }; template SigC::Slot0 convert(const T& slot_, R (*convert_func)(T&)) { return new AdaptorConvertSlotNode((SigC::FuncPtr)(&AdaptorConvertSlot0_::proxy), slot_, (SigC::FuncPtr)(convert_func)); } template struct AdaptorConvertSlot1_ { typedef typename SigC::Trait::type RType; typedef R (*ConvertFunc)(T&,P1); static RType proxy(typename SigC::Trait::ref p1,void *data) { AdaptorConvertSlotNode& node=*(AdaptorConvertSlotNode*)(data); T &slot_=(T&)(node.slot_); return ((ConvertFunc)(node.convert_func_)) (slot_,p1); } }; template SigC::Slot1 convert(const T& slot_, R (*convert_func)(T&,P1)) { return new AdaptorConvertSlotNode((SigC::FuncPtr)(&AdaptorConvertSlot1_::proxy), slot_, (SigC::FuncPtr)(convert_func)); } template struct AdaptorConvertSlot2_ { typedef typename SigC::Trait::type RType; typedef R (*ConvertFunc)(T&,P1,P2); static RType proxy(typename SigC::Trait::ref p1,typename SigC::Trait::ref p2,void *data) { AdaptorConvertSlotNode& node=*(AdaptorConvertSlotNode*)(data); T &slot_=(T&)(node.slot_); return ((ConvertFunc)(node.convert_func_)) (slot_,p1,p2); } }; template SigC::Slot2 convert(const T& slot_, R (*convert_func)(T&,P1,P2)) { return new AdaptorConvertSlotNode((SigC::FuncPtr)(&AdaptorConvertSlot2_::proxy), slot_, (SigC::FuncPtr)(convert_func)); } template struct AdaptorConvertSlot3_ { typedef typename SigC::Trait::type RType; typedef R (*ConvertFunc)(T&,P1,P2,P3); static RType proxy(typename SigC::Trait::ref p1,typename SigC::Trait::ref p2,typename SigC::Trait::ref p3,void *data) { AdaptorConvertSlotNode& node=*(AdaptorConvertSlotNode*)(data); T &slot_=(T&)(node.slot_); return ((ConvertFunc)(node.convert_func_)) (slot_,p1,p2,p3); } }; template SigC::Slot3 convert(const T& slot_, R (*convert_func)(T&,P1,P2,P3)) { return new AdaptorConvertSlotNode((SigC::FuncPtr)(&AdaptorConvertSlot3_::proxy), slot_, (SigC::FuncPtr)(convert_func)); } template struct AdaptorConvertSlot4_ { typedef typename SigC::Trait::type RType; typedef R (*ConvertFunc)(T&,P1,P2,P3,P4); static RType proxy(typename SigC::Trait::ref p1,typename SigC::Trait::ref p2,typename SigC::Trait::ref p3,typename SigC::Trait::ref p4,void *data) { AdaptorConvertSlotNode& node=*(AdaptorConvertSlotNode*)(data); T &slot_=(T&)(node.slot_); return ((ConvertFunc)(node.convert_func_)) (slot_,p1,p2,p3,p4); } }; template SigC::Slot4 convert(const T& slot_, R (*convert_func)(T&,P1,P2,P3,P4)) { return new AdaptorConvertSlotNode((SigC::FuncPtr)(&AdaptorConvertSlot4_::proxy), slot_, (SigC::FuncPtr)(convert_func)); } template struct AdaptorConvertSlot5_ { typedef typename SigC::Trait::type RType; typedef R (*ConvertFunc)(T&,P1,P2,P3,P4,P5); static RType proxy(typename SigC::Trait::ref p1,typename SigC::Trait::ref p2,typename SigC::Trait::ref p3,typename SigC::Trait::ref p4,typename SigC::Trait::ref p5,void *data) { AdaptorConvertSlotNode& node=*(AdaptorConvertSlotNode*)(data); T &slot_=(T&)(node.slot_); return ((ConvertFunc)(node.convert_func_)) (slot_,p1,p2,p3,p4,p5); } }; template SigC::Slot5 convert(const T& slot_, R (*convert_func)(T&,P1,P2,P3,P4,P5)) { return new AdaptorConvertSlotNode((SigC::FuncPtr)(&AdaptorConvertSlot5_::proxy), slot_, (SigC::FuncPtr)(convert_func)); } template struct AdaptorConvertSlot6_ { typedef typename SigC::Trait::type RType; typedef R (*ConvertFunc)(T&,P1,P2,P3,P4,P5,P6); static RType proxy(typename SigC::Trait::ref p1,typename SigC::Trait::ref p2,typename SigC::Trait::ref p3,typename SigC::Trait::ref p4,typename SigC::Trait::ref p5,typename SigC::Trait::ref p6,void *data) { AdaptorConvertSlotNode& node=*(AdaptorConvertSlotNode*)(data); T &slot_=(T&)(node.slot_); return ((ConvertFunc)(node.convert_func_)) (slot_,p1,p2,p3,p4,p5,p6); } }; template SigC::Slot6 convert(const T& slot_, R (*convert_func)(T&,P1,P2,P3,P4,P5,P6)) { return new AdaptorConvertSlotNode((SigC::FuncPtr)(&AdaptorConvertSlot6_::proxy), slot_, (SigC::FuncPtr)(convert_func)); } #ifdef SIGC_CXX_NAMESPACES } #endif #endif // SIGC_CONVERT_H