1 The following things are be available to powerusers.
3 - changing the return type of a slot
4 - changing the paramete types of slot
8 =======================================================================
11 Slots can be made to change their input types based on a static function.
15 // write some conversion functions
16 int convert_mysignal_c(Callback1<int,const char*> *s,const string &str)
17 {return s->call(str.c_str());}
18 Slot1<int,const string&> myconvert(const Slot1<int,const char*> &s)
19 {return convert(s,convert_mysignal_c);}
22 Signal1<int,const string&> mysignal;
24 mysignal.connect(myconvert(slot(foo));
29 One signal can have multiple behavior for a single signal name.
30 This is done with multiple inheritance.
38 :public Signal1<int,int>,
39 public Signal1<void,double>
45 myclass.mysig.connect(slot(foo));
46 myclass.mysig.connect(slot(foo2));
47 myclass.mysig(1); // calls foo
48 myclass.mysig(1.0); // calls foo2
54 A signal can be made to accept a wide group of slots with similar data
63 class MySig: public Signal1<int,string&>
65 static int _mysig_convert(Callback1<int,const char*> *s,
67 {return s->call(str.c_str());}
69 Connection connect(const Slot1<int,const char*> &s)
70 {return connect(convert(s,_mysig_convert));}
74 int foo(const char* c);
77 mysig.connect(slot(foo)); // this is acceptable
78 mysig.connect(slot(foo2)); // this is also acceptable
80 mysig(h); // calls both foo and foo2.
85 * Signal overloading over classes
87 This should be extendable accross different levels of a class.
89 Example: (details still in progress)
93 * Signals with translation
95 Signals can be made to convert and proxy accross other systems.