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.
Fork of BLE_API by
Diff: ble/FunctionPointerWithContext.h
- Revision:
- 1046:87a2ebe45470
- Parent:
- 1045:b9d15970040f
- Child:
- 1048:efb29faf12fc
diff -r b9d15970040f -r 87a2ebe45470 ble/FunctionPointerWithContext.h --- a/ble/FunctionPointerWithContext.h Mon Jan 11 08:51:26 2016 +0000 +++ b/ble/FunctionPointerWithContext.h Mon Jan 11 08:51:27 2016 +0000 @@ -34,7 +34,7 @@ * @param function The void static function to attach (default is none) */ FunctionPointerWithContext(void (*function)(ContextType context) = NULL) : - _function(NULL), _caller(NULL), _next(NULL) { + _memberFunctionAndPointer(), _caller(NULL), _next(NULL) { attach(function); } @@ -49,6 +49,17 @@ attach(object, member); } + FunctionPointerWithContext(const FunctionPointerWithContext& that) : + _memberFunctionAndPointer(that._memberFunctionAndPointer), _caller(that._caller), _next(NULL) { + } + + FunctionPointerWithContext& operator=(const FunctionPointerWithContext& that) { + _memberFunctionAndPointer = that._memberFunctionAndPointer; + _caller = that._caller; + _next = NULL; + return *this; + } + /** Attach a static function * * @param function The void static function to attach (default is none)