Skip to content

Commit 3d1c259

Browse files
kegilbertadbridge
authored andcommitted
Final cleanup of eventqueue doxy comments
1 parent 1ae9ce9 commit 3d1c259

File tree

1 file changed

+55
-18
lines changed

1 file changed

+55
-18
lines changed

events/EventQueue.h

Lines changed: 55 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
184184
void chain(EventQueue *target);
185185

186186

187+
187188
#if defined(DOXYGEN_ONLY)
188189
/** Calls an event on the queue
189190
*
@@ -202,6 +203,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
202203
* executing.
203204
*
204205
* @code
206+
* #include "mbed.h"
207+
*
205208
* int main() {
206209
* // creates a queue with the default size
207210
* EventQueue queue;
@@ -235,6 +238,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
235238
* executing.
236239
*
237240
* @code
241+
* #include "mbed.h"
242+
*
238243
* class EventHandler {
239244
* int _id;
240245
* public:
@@ -279,6 +284,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
279284
* enough memory to allocate the event.
280285
*
281286
* @code
287+
* #include "mbed.h"
288+
*
282289
* int main() {
283290
* // creates a queue with the default size
284291
* EventQueue queue;
@@ -311,6 +318,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
311318
* enough memory to allocate the event.
312319
*
313320
* @code
321+
* #include "mbed.h"
322+
*
314323
* class EventHandler {
315324
* int _id;
316325
* public:
@@ -359,6 +368,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
359368
* enough memory to allocate the event.
360369
*
361370
* @code
371+
* #include "mbed.h"
372+
*
362373
* class EventHandler {
363374
* int _id;
364375
* public:
@@ -401,6 +412,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
401412
* @param args Arguments to pass to the callback
402413
*
403414
* @code
415+
* #include "mbed.h"
416+
*
404417
* class EventHandler {
405418
* int _id;
406419
* public:
@@ -436,11 +449,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
436449
* callback acts as the target for the event and is executed in the
437450
* context of the event queue's dispatch loop once posted.
438451
*
439-
* @tparam R TODO
440-
* @tparam Args TODO
441-
* @tparam BoundArgs TODO
442452
* @param func Function to execute when the event is dispatched
443-
* @param args TODO
453+
* @param args Arguments to pass to the callback
444454
* @return Event that will dispatch on the specific queue
445455
*
446456
* @code
@@ -460,6 +470,13 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
460470
*
461471
* // Create event and post parameter later
462472
* 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+
*
463480
* e2.post(2);
464481
*
465482
* queue.dispatch();
@@ -475,14 +492,9 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
475492
* callback acts as the target for the event and is executed in the
476493
* context of the event queue's dispatch loop once posted.
477494
*
478-
* @tparam T TODO
479-
* @tparam R TODO
480-
* @tparam BoundArgs TODO
481-
* @tparam ContextArg TODO
482-
* @tparam Args TODO
483495
* @param obj Object to call with the member function
484496
* @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
486498
* @return Event that will dispatch on the specific queue
487499
*
488500
* @code
@@ -503,11 +515,15 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
503515
* {
504516
* EventQueue queue;
505517
*
506-
* EventHandler handler_cb(5);
518+
* EventHandler handler_cb(10);
507519
*
508520
* // Create event on the eventqueue with a method callback
509521
* 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
511527
* queue.dispatch();
512528
* }
513529
* @endcode
@@ -521,13 +537,34 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
521537
* callback acts as the target for the event and is executed in the
522538
* context of the event queue's dispatch loop once posted.
523539
*
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
530542
* @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
531568
*/
532569
template <typename R, typename ...BoundArgs, typename ...ContextArgs, typename ...Args>
533570
Event<void(Args...)> event(mbed::Callback<R(BoundArgs..., Args...)> cb, ContextArgs ...context_args);

0 commit comments

Comments
 (0)