Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
this way, they can be used as inputs to std::bind1st and friends
|
|
previously they declared the parameter, but ignored the return value of the member function. I've
changed it so they pass the return value, if it is not void. MemFunSelectArg didn't have the
ReturnType template parameter, so I added it for consistency. Since I was already editing the, I
made all the operator()s const.
|
|
|
|
The MemFunSelectArg* functions can be used to select
a specific argument from a signal. For example this would
select the string argument as argument to the callback:
Signal<void, int, float, string> signal;
signal.connect(MemFunSelectArg2(obj, &Object::takesOneStringArg));
signal.emit(10, 3.14, "hello");
...
void Object::takesOneStringArg(const string& value) {
...
}
|
|
|
|
For example connecting a function that takes two arguments
to a signal that emits three arguments:
struct Functor {
void show(int a, int b);
};
Functor f;
Signal<void, int, int, int> s3;
s3.connect(MemFunIgnoreArgs(f, &Functor::show));
|
|
This is suppose to replace the obsolete Subject/Observer classes.
See the src/tests/testSignals.cc for basic usage.
|