Additional documentation at: http://codeplea.com/pluscallback
PlusCallback is a C++ library, contained in a single header file, that implements easy to use function and method callbacks. It is completely contained in one header file, so it's trivial to add to your projects. It also uses the simplest syntax of any callback method I've ever seen (for C++), and it's quite flexible.
//Setup callback for TestObject.Foo().
cb::Callback1<int, int> callback(&TestObject, &TestClass::Foo);
//Call TestObject.Foo(5).
callback(5);
//Change callback to a free function.
callback = SomeRandomFunction;
//Call SomeRandomFunction(8).
callback(8);
This entire library is contained in one header file. Simply include callback.hpp in your project.
Some examples are included in the examples directory:
This library comes pre-built. If you would like to rebuild this library, you need to run build.tcl with the TCL interpreter. You can obtain TCL from http://www.tcl.tk/ When rebuilding, you can change the maximum number of parameters supported by callbacks.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4