mbed libraries for KL25Z
Diff: FunctionPointer.h
- Revision:
- 8:c14af7958ef5
- Parent:
- 7:73c5efe92a6c
- Child:
- 9:663789d7729f
diff -r 73c5efe92a6c -r c14af7958ef5 FunctionPointer.h --- a/FunctionPointer.h Tue Oct 23 09:20:18 2012 +0000 +++ b/FunctionPointer.h Fri Nov 09 11:33:53 2012 +0000 @@ -8,45 +8,37 @@ namespace mbed { -/* Class FunctionPointer - * A class for storing and calling a pointer to a static or member void function +/** A class for storing and calling a pointer to a static or member void function */ class FunctionPointer { public: - /* Constructor FunctionPointer - * Create a FunctionPointer, attaching a static function + + /** Create a FunctionPointer, attaching a static function * - * Variables - * function - The void static function to attach (default is none) + * @param function The void static function to attach (default is none) */ FunctionPointer(void (*function)(void) = 0); - /* Constructor FunctionPointer - * Create a FunctionPointer, attaching a member function + /** Create a FunctionPointer, attaching a member function * - * Variables - * object - The object pointer to invoke the member function on (i.e. the this pointer) - * function - The address of the void member function to attach + * @param object The object pointer to invoke the member function on (i.e. the this pointer) + * @param function The address of the void member function to attach */ template<typename T> FunctionPointer(T *object, void (T::*member)(void)) { attach(object, member); } - /* Function attach - * Attach a static function + /** Attach a static function * - * Variables - * function - The void static function to attach (default is none) + * @param function The void static function to attach (default is none) */ void attach(void (*function)(void) = 0); - /* Function attach - * Attach a member function + /** Attach a member function * - * Variables - * object - The object pointer to invoke the member function on (i.e. the this pointer) - * function - The address of the void member function to attach + * @param object The object pointer to invoke the member function on (i.e. the this pointer) + * @param function The address of the void member function to attach */ template<typename T> void attach(T *object, void (T::*member)(void)) { @@ -56,8 +48,7 @@ _function = 0; } - /* Function call - * Call the attached static or member function (safe to be called even if there is no handler) + /** Call the attached static or member function */ void call(); @@ -74,7 +65,6 @@ void *_object; // object this pointer - 0 if none attached char _member[16]; // raw member function pointer storage - converted back by registered _membercaller void (*_membercaller)(void*, char*); // registered membercaller function to convert back and call _member on _object - }; } // namespace mbed