@@ -184,6 +184,7 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
184
184
void chain (EventQueue *target);
185
185
186
186
187
+
187
188
#if defined(DOXYGEN_ONLY)
188
189
/* * Calls an event on the queue
189
190
*
@@ -202,6 +203,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
202
203
* executing.
203
204
*
204
205
* @code
206
+ * #include "mbed.h"
207
+ *
205
208
* int main() {
206
209
* // creates a queue with the default size
207
210
* EventQueue queue;
@@ -235,6 +238,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
235
238
* executing.
236
239
*
237
240
* @code
241
+ * #include "mbed.h"
242
+ *
238
243
* class EventHandler {
239
244
* int _id;
240
245
* public:
@@ -279,6 +284,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
279
284
* enough memory to allocate the event.
280
285
*
281
286
* @code
287
+ * #include "mbed.h"
288
+ *
282
289
* int main() {
283
290
* // creates a queue with the default size
284
291
* EventQueue queue;
@@ -311,6 +318,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
311
318
* enough memory to allocate the event.
312
319
*
313
320
* @code
321
+ * #include "mbed.h"
322
+ *
314
323
* class EventHandler {
315
324
* int _id;
316
325
* public:
@@ -359,6 +368,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
359
368
* enough memory to allocate the event.
360
369
*
361
370
* @code
371
+ * #include "mbed.h"
372
+ *
362
373
* class EventHandler {
363
374
* int _id;
364
375
* public:
@@ -401,6 +412,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
401
412
* @param args Arguments to pass to the callback
402
413
*
403
414
* @code
415
+ * #include "mbed.h"
416
+ *
404
417
* class EventHandler {
405
418
* int _id;
406
419
* public:
@@ -436,11 +449,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
436
449
* callback acts as the target for the event and is executed in the
437
450
* context of the event queue's dispatch loop once posted.
438
451
*
439
- * @tparam R TODO
440
- * @tparam Args TODO
441
- * @tparam BoundArgs TODO
442
452
* @param func Function to execute when the event is dispatched
443
- * @param args TODO
453
+ * @param args Arguments to pass to the callback
444
454
* @return Event that will dispatch on the specific queue
445
455
*
446
456
* @code
@@ -460,6 +470,13 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
460
470
*
461
471
* // Create event and post parameter later
462
472
* Event<void(int)> e2 = queue.event(handler);
473
+ *
474
+ * // Post the event with paramter 8
475
+ * e.post(8);
476
+ *
477
+ * // Events are executed by the dispatch method
478
+ * queue.dispatch();
479
+ *
463
480
* e2.post(2);
464
481
*
465
482
* queue.dispatch();
@@ -475,14 +492,9 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
475
492
* callback acts as the target for the event and is executed in the
476
493
* context of the event queue's dispatch loop once posted.
477
494
*
478
- * @tparam T TODO
479
- * @tparam R TODO
480
- * @tparam BoundArgs TODO
481
- * @tparam ContextArg TODO
482
- * @tparam Args TODO
483
495
* @param obj Object to call with the member function
484
496
* @param method Member function to execute in the context of the dispatch loop
485
- * @param context_args TODO
497
+ * @param context_args Arguments to pass to the callback
486
498
* @return Event that will dispatch on the specific queue
487
499
*
488
500
* @code
@@ -503,11 +515,15 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
503
515
* {
504
516
* EventQueue queue;
505
517
*
506
- * EventHandler handler_cb(5 );
518
+ * EventHandler handler_cb(10 );
507
519
*
508
520
* // Create event on the eventqueue with a method callback
509
521
* Event<void(int)> e = queue.event(&handler_cb, &EventHandler::handler);
510
- * e.post(1);
522
+ *
523
+ * // Post the event with paramter 8
524
+ * e.post(11);
525
+ *
526
+ * // Events are executed by the dispatch method
511
527
* queue.dispatch();
512
528
* }
513
529
* @endcode
@@ -521,13 +537,34 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
521
537
* callback acts as the target for the event and is executed in the
522
538
* context of the event queue's dispatch loop once posted.
523
539
*
524
- * @tparam templateArgs TODO
525
- * @tparam R TODO
526
- * @param cb TODO
527
- * @tparam Args TODO
528
- * @tparam BoundArgs TODO
529
- * @param context_args TODO
540
+ * @param cb Callback object
541
+ * @param context_args Arguments to pass to the callback
530
542
* @return Event that will dispatch on the specific queue
543
+ *
544
+ * @code
545
+ * #include "mbed.h"
546
+ *
547
+ * void handler(int c) {
548
+ * printf("Param: %d\r\n", c);
549
+ * }
550
+ *
551
+ * int main()
552
+ * {
553
+ * EventQueue queue;
554
+ * // Create callback object acting as a function
555
+ * // pointer to handler
556
+ * Callback<void(int)> cb(handler);
557
+ *
558
+ * // Pass the callback object to the eventqueue
559
+ * Event<void(int)> e = queue.event(cb);
560
+ *
561
+ * // Post the event with parameter 8
562
+ * e.post(9);
563
+ *
564
+ * // events are executed by the dispatch method
565
+ * q.dispatch();
566
+ * }
567
+ * @endcode
531
568
*/
532
569
template <typename R, typename ...BoundArgs, typename ...ContextArgs, typename ...Args>
533
570
Event<void (Args...)> event (mbed::Callback<R(BoundArgs..., Args...)> cb, ContextArgs ...context_args);
0 commit comments