Skip to content

Commit 383b464

Browse files
committed
Final cleanup of eventqueue doxy comments
1 parent a08ade3 commit 383b464

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
@@ -181,6 +181,7 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
181181
void chain(EventQueue *target);
182182

183183

184+
184185
#if defined(DOXYGEN_ONLY)
185186
/** Calls an event on the queue
186187
*
@@ -199,6 +200,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
199200
* executing.
200201
*
201202
* @code
203+
* #include "mbed.h"
204+
*
202205
* int main() {
203206
* // creates a queue with the default size
204207
* EventQueue queue;
@@ -232,6 +235,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
232235
* executing.
233236
*
234237
* @code
238+
* #include "mbed.h"
239+
*
235240
* class EventHandler {
236241
* int _id;
237242
* public:
@@ -276,6 +281,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
276281
* enough memory to allocate the event.
277282
*
278283
* @code
284+
* #include "mbed.h"
285+
*
279286
* int main() {
280287
* // creates a queue with the default size
281288
* EventQueue queue;
@@ -308,6 +315,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
308315
* enough memory to allocate the event.
309316
*
310317
* @code
318+
* #include "mbed.h"
319+
*
311320
* class EventHandler {
312321
* int _id;
313322
* public:
@@ -356,6 +365,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
356365
* enough memory to allocate the event.
357366
*
358367
* @code
368+
* #include "mbed.h"
369+
*
359370
* class EventHandler {
360371
* int _id;
361372
* public:
@@ -398,6 +409,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
398409
* @param args Arguments to pass to the callback
399410
*
400411
* @code
412+
* #include "mbed.h"
413+
*
401414
* class EventHandler {
402415
* int _id;
403416
* public:
@@ -433,11 +446,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
433446
* callback acts as the target for the event and is executed in the
434447
* context of the event queue's dispatch loop once posted.
435448
*
436-
* @tparam R TODO
437-
* @tparam Args TODO
438-
* @tparam BoundArgs TODO
439449
* @param func Function to execute when the event is dispatched
440-
* @param args TODO
450+
* @param args Arguments to pass to the callback
441451
* @return Event that will dispatch on the specific queue
442452
*
443453
* @code
@@ -457,6 +467,13 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
457467
*
458468
* // Create event and post parameter later
459469
* 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+
*
460477
* e2.post(2);
461478
*
462479
* queue.dispatch();
@@ -472,14 +489,9 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
472489
* callback acts as the target for the event and is executed in the
473490
* context of the event queue's dispatch loop once posted.
474491
*
475-
* @tparam T TODO
476-
* @tparam R TODO
477-
* @tparam BoundArgs TODO
478-
* @tparam ContextArg TODO
479-
* @tparam Args TODO
480492
* @param obj Object to call with the member function
481493
* @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
483495
* @return Event that will dispatch on the specific queue
484496
*
485497
* @code
@@ -500,11 +512,15 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
500512
* {
501513
* EventQueue queue;
502514
*
503-
* EventHandler handler_cb(5);
515+
* EventHandler handler_cb(10);
504516
*
505517
* // Create event on the eventqueue with a method callback
506518
* 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
508524
* queue.dispatch();
509525
* }
510526
* @endcode
@@ -518,13 +534,34 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
518534
* callback acts as the target for the event and is executed in the
519535
* context of the event queue's dispatch loop once posted.
520536
*
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
527539
* @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
528565
*/
529566
template <typename R, typename ...BoundArgs, typename ...ContextArgs, typename ...Args>
530567
Event<void(Args...)> event(mbed::Callback<R(BoundArgs..., Args...)> cb, ContextArgs ...context_args);

0 commit comments

Comments
 (0)