@@ -183,6 +183,181 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
183
183
*/
184
184
void chain (EventQueue *target);
185
185
186
+
187
+ #if defined(DOXYGEN_ONLY)
188
+ /* * Calls an event on the queue
189
+ *
190
+ * The specified callback will be executed in the context of the event
191
+ * queue's dispatch loop.
192
+ *
193
+ * The call function is irq safe and can act as a mechanism for moving
194
+ * events out of irq contexts.
195
+ *
196
+ * @param f Function to execute in the context of the dispatch loop
197
+ * @param args Arguments to pass to the callback
198
+ * @return A unique id that represents the posted event and can
199
+ * be passed to cancel, or an id of 0 if there is not
200
+ * enough memory to allocate the event.
201
+ * Returned id will remain valid until event has finished
202
+ * executing.
203
+ */
204
+ template <typename F, typename ...Args>
205
+ int call (F f, Args ...args);
206
+
207
+ /* * Calls an event on the queue
208
+ *
209
+ * The specified callback will be executed in the context of the event
210
+ * queue's dispatch loop.
211
+ *
212
+ * The call function is irq safe and can act as a mechanism for moving
213
+ * events out of irq contexts.
214
+ *
215
+ * @param obj Object to call with the member function
216
+ * @param method Member function to execute in the context of the dispatch loop
217
+ * @param args Arguments to pass to the callback
218
+ * @return A unique id that represents the posted event and can
219
+ * be passed to cancel, or an id of 0 if there is not
220
+ * enough memory to allocate the event.
221
+ * Returned id will remain valid until event has finished
222
+ * executing.
223
+ */
224
+ template <typename T, typename R, typename ...Args>
225
+ int call (T *obj, R (T::*method)(Args ...args), Args ...args);
226
+
227
+ /* * Calls an event on the queue after a specified delay
228
+ *
229
+ * The specified callback will be executed in the context of the event
230
+ * queue's dispatch loop.
231
+ *
232
+ * The call_in function is irq safe and can act as a mechanism for moving
233
+ * events out of irq contexts.
234
+ *
235
+ * @param ms Time to delay in milliseconds
236
+ * @param args Arguments to pass to the callback
237
+ * @return A unique id that represents the posted event and can
238
+ * be passed to cancel, or an id of 0 if there is not
239
+ * enough memory to allocate the event.
240
+ */
241
+ template <typename F, typename ...Args>
242
+ int call_in (int ms, Args ...args);
243
+
244
+ /* * Calls an event on the queue after a specified delay
245
+ *
246
+ * The specified callback will be executed in the context of the event
247
+ * queue's dispatch loop.
248
+ *
249
+ * The call_in function is irq safe and can act as a mechanism for moving
250
+ * events out of irq contexts.
251
+ *
252
+ * @param ms Time to delay in milliseconds
253
+ * @param obj Object to call with the member function
254
+ * @param method Member function to execute in the context of the dispatch loop
255
+ * @param args Arguments to pass to the callback
256
+ * @return A unique id that represents the posted event and can
257
+ * be passed to cancel, or an id of 0 if there is not
258
+ * enough memory to allocate the event.
259
+ */
260
+ template <typename T, typename R, typename ...Args>
261
+ int call_in (int ms, T *obj, R (T::*method)(Args ...args), Args ...args);
262
+
263
+ /* * Calls an event on the queue periodically
264
+ *
265
+ * @note The first call_every event occurs after the specified delay.
266
+ * To create a periodic event that fires immediately, @see Event.
267
+ *
268
+ * The specified callback will be executed in the context of the event
269
+ * queue's dispatch loop.
270
+ *
271
+ * The call_every function is irq safe and can act as a mechanism for
272
+ * moving events out of irq contexts.
273
+ *
274
+ * @param ms Period of the event in milliseconds
275
+ * @param f Function to execute in the context of the dispatch loop
276
+ * @param args Arguments to pass to the callback
277
+ * @return A unique id that represents the posted event and can
278
+ * be passed to cancel, or an id of 0 if there is not
279
+ * enough memory to allocate the event.
280
+ */
281
+ template <typename F, typename ...Args>
282
+ int call_every (int ms, F f, Args ...args);
283
+
284
+ /* * Calls an event on the queue periodically
285
+ *
286
+ * @note The first call_every event occurs after the specified delay.
287
+ * To create a periodic event that fires immediately, @see Event.
288
+ *
289
+ * The specified callback will be executed in the context of the event
290
+ * queue's dispatch loop.
291
+ *
292
+ * The call_every function is irq safe and can act as a mechanism for
293
+ * moving events out of irq contexts.
294
+ *
295
+ * @param ms Period of the event in milliseconds
296
+ * @param obj Object to call with the member function
297
+ * @param method Member function to execute in the context of the dispatch loop
298
+ * @param args Arguments to pass to the callback
299
+ */
300
+ template <typename T, typename R, typename ...Args>
301
+ int call_every (int ms, T *obj, R (T::*method)(Args ...args), Args ...args);
302
+
303
+ /* * Creates an event bound to the event queue
304
+ *
305
+ * Constructs an event bound to the specified event queue. The specified
306
+ * callback acts as the target for the event and is executed in the
307
+ * context of the event queue's dispatch loop once posted.
308
+ *
309
+ * @tparam R TODO
310
+ * @tparam Args TODO
311
+ * @tparam BoundArgs TODO
312
+ * @param func Function to execute when the event is dispatched
313
+ * @param args TODO
314
+ * @return Event that will dispatch on the specific queue
315
+ *
316
+ * @code
317
+ * event(...TODO....);
318
+ * @endcode
319
+ */
320
+ template <typename R, typename ...BoundArgs, typename ...Args>
321
+ Event<void (Args...)> event (R (*func)(BoundArgs...), Args ...args);
322
+
323
+ /* * Creates an event bound to the event queue
324
+ *
325
+ * Constructs an event bound to the specified event queue. The specified
326
+ * callback acts as the target for the event and is executed in the
327
+ * context of the event queue's dispatch loop once posted.
328
+ *
329
+ * @tparam T TODO
330
+ * @tparam R TODO
331
+ * @tparam BoundArgs TODO
332
+ * @tparam ContextArg TODO
333
+ * @tparam Args TODO
334
+ * @param obj Object to call with the member function
335
+ * @param method Member function to execute in the context of the dispatch loop
336
+ * @param context_args TODO
337
+ * @return Event that will dispatch on the specific queue
338
+ */
339
+ template <typename T, typename R, typename ...BoundArgs, typename ...ContextArgs, typename ...Args>
340
+ Event<void (Args...)> event (T *obj, R (T::*method)(BoundArgs..., Args...), ContextArgs ...context_args);
341
+
342
+ /* * Creates an event bound to the event queue
343
+ *
344
+ * Constructs an event bound to the specified event queue. The specified
345
+ * callback acts as the target for the event and is executed in the
346
+ * context of the event queue's dispatch loop once posted.
347
+ *
348
+ * @tparam templateArgs TODO
349
+ * @tparam R TODO
350
+ * @param cb TODO
351
+ * @tparam Args TODO
352
+ * @tparam BoundArgs TODO
353
+ * @param context_args TODO
354
+ * @return Event that will dispatch on the specific queue
355
+ */
356
+ template <typename R, typename ...BoundArgs, typename ...ContextArgs, typename ...Args>
357
+ Event<void (Args...)> event (mbed::Callback<R(BoundArgs..., Args...)> cb, ContextArgs ...context_args);
358
+
359
+ #else
360
+
186
361
/* * Calls an event on the queue
187
362
*
188
363
* The specified callback will be executed in the context of the event
@@ -211,6 +386,7 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
211
386
return equeue_post (&_equeue, &EventQueue::function_call<F>, e);
212
387
}
213
388
389
+
214
390
/* * Calls an event on the queue
215
391
* @see EventQueue::call
216
392
* @param f Function to execute in the context of the dispatch loop
@@ -490,8 +666,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
490
666
* The call_in function is irq safe and can act as a mechanism for moving
491
667
* events out of irq contexts.
492
668
*
493
- * @param f Function to execute in the context of the dispatch loop
494
669
* @param ms Time to delay in milliseconds
670
+ * @param f Function to execute in the context of the dispatch loop
495
671
* @return A unique id that represents the posted event and can
496
672
* be passed to cancel, or an id of 0 if there is not
497
673
* enough memory to allocate the event.
@@ -2395,6 +2571,7 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
2395
2571
*/
2396
2572
template <typename R, typename B0, typename B1, typename B2, typename B3, typename B4, typename C0, typename C1, typename C2, typename C3, typename C4, typename A0, typename A1, typename A2, typename A3, typename A4>
2397
2573
Event<void (A0, A1, A2, A3, A4)> event (mbed::Callback<R(B0, B1, B2, B3, B4, A0, A1, A2, A3, A4)> cb, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
2574
+ #endif
2398
2575
2399
2576
protected:
2400
2577
template <typename F>
0 commit comments