Skip to content

Commit 891b06e

Browse files
committed
Deprecate CallChain
This patch deprecates the CallChain class since it is an internal API (not in mbed.h) and is only being used by InterruptManager which is also deprecated.
1 parent 8deef6a commit 891b06e

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

platform/CallChain.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2+
// Suppress deprecation warnings since this whole
3+
// class is deprecated already
4+
#include "mbed_toolchain.h"
5+
#undef MBED_DEPRECATED_SINCE
6+
#define MBED_DEPRECATED_SINCE(...)
7+
18
#include "platform/CallChain.h"
29
#include "cmsis.h"
310
#include "platform/mbed_critical.h"

platform/CallChain.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,12 @@ class CallChain : private NonCopyable<CallChain> {
7272
*
7373
* @param size (optional) Initial size of the chain
7474
*/
75+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
76+
"public API of mbed-os and is being removed in the future.")
7577
CallChain(int size = 4);
78+
79+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
80+
"public API of mbed-os and is being removed in the future.")
7681
virtual ~CallChain();
7782

7883
/** Add a function at the end of the chain
@@ -82,6 +87,8 @@ class CallChain : private NonCopyable<CallChain> {
8287
* @returns
8388
* The function object created for 'func'
8489
*/
90+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
91+
"public API of mbed-os and is being removed in the future.")
8592
pFunctionPointer_t add(Callback<void()> func);
8693

8794
/** Add a function at the end of the chain
@@ -111,6 +118,8 @@ class CallChain : private NonCopyable<CallChain> {
111118
* @returns
112119
* The function object created for 'func'
113120
*/
121+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
122+
"public API of mbed-os and is being removed in the future.")
114123
pFunctionPointer_t add_front(Callback<void()> func);
115124

116125
/** Add a function at the beginning of the chain
@@ -135,6 +144,8 @@ class CallChain : private NonCopyable<CallChain> {
135144

136145
/** Get the number of functions in the chain
137146
*/
147+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
148+
"public API of mbed-os and is being removed in the future.")
138149
int size() const;
139150

140151
/** Get a function object from the chain
@@ -144,6 +155,8 @@ class CallChain : private NonCopyable<CallChain> {
144155
* @returns
145156
* The function object at position 'i' in the chain
146157
*/
158+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
159+
"public API of mbed-os and is being removed in the future.")
147160
pFunctionPointer_t get(int i) const;
148161

149162
/** Look for a function object in the call chain
@@ -153,10 +166,14 @@ class CallChain : private NonCopyable<CallChain> {
153166
* @returns
154167
* The index of the function object if found, -1 otherwise.
155168
*/
169+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
170+
"public API of mbed-os and is being removed in the future.")
156171
int find(pFunctionPointer_t f) const;
157172

158173
/** Clear the call chain (remove all functions in the chain).
159174
*/
175+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
176+
"public API of mbed-os and is being removed in the future.")
160177
void clear();
161178

162179
/** Remove a function object from the chain
@@ -166,15 +183,24 @@ class CallChain : private NonCopyable<CallChain> {
166183
* @returns
167184
* true if the function object was found and removed, false otherwise.
168185
*/
186+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
187+
"public API of mbed-os and is being removed in the future.")
169188
bool remove(pFunctionPointer_t f);
170189

171190
/** Call all the functions in the chain in sequence
172191
*/
192+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
193+
"public API of mbed-os and is being removed in the future.")
173194
void call();
174195

196+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
197+
"public API of mbed-os and is being removed in the future.")
175198
void operator ()(void) {
176199
call();
177200
}
201+
202+
MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the "
203+
"public API of mbed-os and is being removed in the future.")
178204
pFunctionPointer_t operator [](int i) const {
179205
return get(i);
180206
}

0 commit comments

Comments
 (0)