@@ -181,6 +181,7 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
181
181
void chain (EventQueue *target);
182
182
183
183
184
+
184
185
#if defined(DOXYGEN_ONLY)
185
186
/* * Calls an event on the queue
186
187
*
@@ -199,6 +200,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
199
200
* executing.
200
201
*
201
202
* @code
203
+ * #include "mbed.h"
204
+ *
202
205
* int main() {
203
206
* // creates a queue with the default size
204
207
* EventQueue queue;
@@ -232,6 +235,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
232
235
* executing.
233
236
*
234
237
* @code
238
+ * #include "mbed.h"
239
+ *
235
240
* class EventHandler {
236
241
* int _id;
237
242
* public:
@@ -276,6 +281,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
276
281
* enough memory to allocate the event.
277
282
*
278
283
* @code
284
+ * #include "mbed.h"
285
+ *
279
286
* int main() {
280
287
* // creates a queue with the default size
281
288
* EventQueue queue;
@@ -308,6 +315,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
308
315
* enough memory to allocate the event.
309
316
*
310
317
* @code
318
+ * #include "mbed.h"
319
+ *
311
320
* class EventHandler {
312
321
* int _id;
313
322
* public:
@@ -356,6 +365,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
356
365
* enough memory to allocate the event.
357
366
*
358
367
* @code
368
+ * #include "mbed.h"
369
+ *
359
370
* class EventHandler {
360
371
* int _id;
361
372
* public:
@@ -398,6 +409,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
398
409
* @param args Arguments to pass to the callback
399
410
*
400
411
* @code
412
+ * #include "mbed.h"
413
+ *
401
414
* class EventHandler {
402
415
* int _id;
403
416
* public:
@@ -433,11 +446,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
433
446
* callback acts as the target for the event and is executed in the
434
447
* context of the event queue's dispatch loop once posted.
435
448
*
436
- * @tparam R TODO
437
- * @tparam Args TODO
438
- * @tparam BoundArgs TODO
439
449
* @param func Function to execute when the event is dispatched
440
- * @param args TODO
450
+ * @param args Arguments to pass to the callback
441
451
* @return Event that will dispatch on the specific queue
442
452
*
443
453
* @code
@@ -457,6 +467,13 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
457
467
*
458
468
* // Create event and post parameter later
459
469
* Event<void(int)> e2 = queue.event(handler);
470
+ *
471
+ * // Post the event with paramter 8
472
+ * e.post(8);
473
+ *
474
+ * // Events are executed by the dispatch method
475
+ * queue.dispatch();
476
+ *
460
477
* e2.post(2);
461
478
*
462
479
* queue.dispatch();
@@ -472,14 +489,9 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
472
489
* callback acts as the target for the event and is executed in the
473
490
* context of the event queue's dispatch loop once posted.
474
491
*
475
- * @tparam T TODO
476
- * @tparam R TODO
477
- * @tparam BoundArgs TODO
478
- * @tparam ContextArg TODO
479
- * @tparam Args TODO
480
492
* @param obj Object to call with the member function
481
493
* @param method Member function to execute in the context of the dispatch loop
482
- * @param context_args TODO
494
+ * @param context_args Arguments to pass to the callback
483
495
* @return Event that will dispatch on the specific queue
484
496
*
485
497
* @code
@@ -500,11 +512,15 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
500
512
* {
501
513
* EventQueue queue;
502
514
*
503
- * EventHandler handler_cb(5 );
515
+ * EventHandler handler_cb(10 );
504
516
*
505
517
* // Create event on the eventqueue with a method callback
506
518
* Event<void(int)> e = queue.event(&handler_cb, &EventHandler::handler);
507
- * e.post(1);
519
+ *
520
+ * // Post the event with paramter 8
521
+ * e.post(11);
522
+ *
523
+ * // Events are executed by the dispatch method
508
524
* queue.dispatch();
509
525
* }
510
526
* @endcode
@@ -518,13 +534,34 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
518
534
* callback acts as the target for the event and is executed in the
519
535
* context of the event queue's dispatch loop once posted.
520
536
*
521
- * @tparam templateArgs TODO
522
- * @tparam R TODO
523
- * @param cb TODO
524
- * @tparam Args TODO
525
- * @tparam BoundArgs TODO
526
- * @param context_args TODO
537
+ * @param cb Callback object
538
+ * @param context_args Arguments to pass to the callback
527
539
* @return Event that will dispatch on the specific queue
540
+ *
541
+ * @code
542
+ * #include "mbed.h"
543
+ *
544
+ * void handler(int c) {
545
+ * printf("Param: %d\r\n", c);
546
+ * }
547
+ *
548
+ * int main()
549
+ * {
550
+ * EventQueue queue;
551
+ * // Create callback object acting as a function
552
+ * // pointer to handler
553
+ * Callback<void(int)> cb(handler);
554
+ *
555
+ * // Pass the callback object to the eventqueue
556
+ * Event<void(int)> e = queue.event(cb);
557
+ *
558
+ * // Post the event with parameter 8
559
+ * e.post(9);
560
+ *
561
+ * // events are executed by the dispatch method
562
+ * q.dispatch();
563
+ * }
564
+ * @endcode
528
565
*/
529
566
template <typename R, typename ...BoundArgs, typename ...ContextArgs, typename ...Args>
530
567
Event<void (Args...)> event (mbed::Callback<R(BoundArgs..., Args...)> cb, ContextArgs ...context_args);
0 commit comments