Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: target-freescale
Fork of mbed-hal by
Diff: api/FunctionPointer.h
- Revision:
- 19:f1c94b98286f
- Parent:
- 18:8c5ec1e88a9c
diff -r 8c5ec1e88a9c -r f1c94b98286f api/FunctionPointer.h --- a/api/FunctionPointer.h Wed Apr 06 01:32:26 2016 -0500 +++ b/api/FunctionPointer.h Wed Apr 06 02:13:49 2016 -0500 @@ -58,6 +58,15 @@ attach(object, member); } + /** Create a FuncPtr, attaching a function object + * + * @param object Pointer to a function object to attach + */ + template<typename T> + FuncPtr(T *object) { + attach(object, &T::operator()); + } + /** Create a FuncPtr from another FuncPtr * * @param func The func to attach @@ -100,6 +109,15 @@ _thunk = &FuncPtr::methodthunk<T>; } + /** Attach a function object + * + * @param object Pointer to a function object to attach + */ + template<typename T> + void attach(T *object) { + attach(object, &T::operator()); + } + /** Attach a FuncPtr * * @param func The func to attach @@ -202,6 +220,15 @@ attach(object, member); } + /** Create a FuncPtr, attaching a function object + * + * @param object Pointer to a function object to attach + */ + template<typename T> + FuncPtr(T *object) { + attach(object, &T::operator()); + } + /** Create a FuncPtr from another FuncPtr * * @param func The func to attach @@ -244,6 +271,15 @@ _thunk = &FuncPtr::methodthunk<T>; } + /** Attach a function object + * + * @param object Pointer to a function object to attach + */ + template<typename T> + void attach(T *object) { + attach(object, &T::operator()); + } + /** Attach a FuncPtr * * @param func The func to attach @@ -346,6 +382,15 @@ attach(object, member); } + /** Create a FuncPtr, attaching a function object + * + * @param object Pointer to a function object to attach + */ + template<typename T> + FuncPtr(T *object) { + attach(object, &T::operator()); + } + /** Create a FuncPtr from another FuncPtr * * @param func The func to attach @@ -388,6 +433,15 @@ _thunk = &FuncPtr::methodthunk<T>; } + /** Attach a function object + * + * @param object Pointer to a function object to attach + */ + template<typename T> + void attach(T *object) { + attach(object, &T::operator()); + } + /** Attach a FuncPtr * * @param func The func to attach @@ -490,6 +544,15 @@ attach(object, member); } + /** Create a FuncPtr, attaching a function object + * + * @param object Pointer to a function object to attach + */ + template<typename T> + FuncPtr(T *object) { + attach(object, &T::operator()); + } + /** Create a FuncPtr from another FuncPtr * * @param func The func to attach @@ -532,6 +595,15 @@ _thunk = &FuncPtr::methodthunk<T>; } + /** Attach a function object + * + * @param object Pointer to a function object to attach + */ + template<typename T> + void attach(T *object) { + attach(object, &T::operator()); + } + /** Attach a FuncPtr * * @param func The func to attach @@ -634,6 +706,15 @@ attach(object, member); } + /** Create a FuncPtr, attaching a function object + * + * @param object Pointer to a function object to attach + */ + template<typename T> + FuncPtr(T *object) { + attach(object, &T::operator()); + } + /** Create a FuncPtr from another FuncPtr * * @param func The func to attach @@ -676,6 +757,15 @@ _thunk = &FuncPtr::methodthunk<T>; } + /** Attach a function object + * + * @param object Pointer to a function object to attach + */ + template<typename T> + void attach(T *object) { + attach(object, &T::operator()); + } + /** Attach a FuncPtr * * @param func The func to attach