Skip to content

Commit 04fe577

Browse files
committed
Patch EventQueue doxygen to remove templatewall
In the doxygen only segment define generic function declarations for the docs Finished initial rework, pending TODOs for param comments
1 parent 8f7024a commit 04fe577

File tree

2 files changed

+182
-4
lines changed

2 files changed

+182
-4
lines changed

events/Event.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1890,6 +1890,7 @@ class Event<void(A0, A1, A2, A3)> {
18901890
}
18911891

18921892
public:
1893+
#if !defined(DOXYGEN_ONLY)
18931894
/** Create an event
18941895
* @param q Event queue to dispatch on
18951896
* @param f Function to execute when the event is dispatched
@@ -3619,7 +3620,7 @@ template <typename R, typename B0, typename B1, typename B2, typename B3, typena
36193620
Event<void(A0, A1, A2, A3, A4)> EventQueue::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) {
36203621
return Event<void(A0, A1, A2, A3, A4)>(this, cb, c0, c1, c2, c3, c4);
36213622
}
3622-
3623+
#endif
36233624
}
36243625

36253626
#endif

events/EventQueue.h

Lines changed: 180 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
8484

8585
/** Dispatch events without a timeout
8686
*
87-
* This is equivalent to EventQueue::dispatch with no arguments, but
87+
* This is equivalent to EventQueue::dispatch with no arguments, but
8888
* avoids overload ambiguities when passed as a callback.
8989
*
9090
* @see EventQueue::dispatch
@@ -100,7 +100,7 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
100100

101101
/** Millisecond counter
102102
*
103-
* Returns the underlying tick of the event queue represented as the
103+
* Returns the underlying tick of the event queue represented as the
104104
* number of milliseconds that have passed since an arbitrary point in
105105
* time. Intentionally overflows to 0 after 2^32-1.
106106
*
@@ -180,6 +180,181 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
180180
*/
181181
void chain(EventQueue *target);
182182

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

385+
210386
/** Calls an event on the queue
211387
* @see EventQueue::call
212388
* @param f Function to execute in the context of the dispatch loop
@@ -457,8 +633,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
457633
* The call_in function is irq safe and can act as a mechanism for moving
458634
* events out of irq contexts.
459635
*
460-
* @param f Function to execute in the context of the dispatch loop
461636
* @param ms Time to delay in milliseconds
637+
* @param f Function to execute in the context of the dispatch loop
462638
* @return A unique id that represents the posted event and can
463639
* be passed to cancel, or an id of 0 if there is not
464640
* enough memory to allocate the event.
@@ -2302,6 +2478,7 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
23022478
*/
23032479
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>
23042480
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);
2481+
#endif
23052482

23062483
protected:
23072484
template <typename F>

0 commit comments

Comments
 (0)