Marked FunctionPointer and friends as deprecated

FunctionPointer/FunctionPointerArg0/FunctionPointerArg1 has been
replaced by the more flexible Callback template class.

For the motivation behind adopting the Callback class:
https://github.com/mbedmicro/mbed/pull/1783
pull/2191/head
Christopher Haster 2016-07-18 16:22:21 -05:00
parent 3ea625c8eb
commit ad07ab8174
1 changed files with 5 additions and 0 deletions

View File

@ -17,6 +17,7 @@
#define MBED_FUNCTIONPOINTER_H
#include "Callback.h"
#include "toolchain.h"
#include <string.h>
#include <stdint.h>
@ -28,10 +29,12 @@ namespace mbed {
template <typename R, typename A1>
class FunctionPointerArg1 : public Callback<R(A1)> {
public:
MBED_DEPRECATED("FunctionPointerArg1<R, A> has been replaced by Callback<R(A)>")
FunctionPointerArg1(R (*function)(A1) = 0)
: Callback<R(A1)>(function) {}
template<typename T>
MBED_DEPRECATED("FunctionPointerArg1<R, A> has been replaced by Callback<R(A)>")
FunctionPointerArg1(T *object, R (T::*member)(A1))
: Callback<R(A1)>(object, member) {}
@ -43,10 +46,12 @@ public:
template <typename R>
class FunctionPointerArg1<R, void> : public Callback<R()> {
public:
MBED_DEPRECATED("FunctionPointer has been replaced by Callback<void()>")
FunctionPointerArg1(R (*function)() = 0)
: Callback<R()>(function) {}
template<typename T>
MBED_DEPRECATED("FunctionPointer has been replaced by Callback<void()>")
FunctionPointerArg1(T *object, R (T::*member)())
: Callback<R()>(object, member) {}