Skip to content

Commit 5422eb5

Browse files
kegilbertadbridge
authored andcommitted
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 7278d1d commit 5422eb5

File tree

2 files changed

+180
-2
lines changed

2 files changed

+180
-2
lines changed

events/Event.h

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

20572057
public:
2058+
#if !defined(DOXYGEN_ONLY)
20582059
/** Create an event
20592060
* @param q Event queue to dispatch on
20602061
* @param f Function to execute when the event is dispatched
@@ -4063,7 +4064,7 @@ Event<void(A0, A1, A2, A3, A4)> EventQueue::event(mbed::Callback<R(B0, B1, B2, B
40634064
{
40644065
return Event<void(A0, A1, A2, A3, A4)>(this, cb, c0, c1, c2, c3, c4);
40654066
}
4066-
4067+
#endif
40674068
}
40684069

40694070
#endif

events/EventQueue.h

Lines changed: 178 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,181 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
183183
*/
184184
void chain(EventQueue *target);
185185

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

389+
214390
/** Calls an event on the queue
215391
* @see EventQueue::call
216392
* @param f Function to execute in the context of the dispatch loop
@@ -490,8 +666,8 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
490666
* The call_in function is irq safe and can act as a mechanism for moving
491667
* events out of irq contexts.
492668
*
493-
* @param f Function to execute in the context of the dispatch loop
494669
* @param ms Time to delay in milliseconds
670+
* @param f Function to execute in the context of the dispatch loop
495671
* @return A unique id that represents the posted event and can
496672
* be passed to cancel, or an id of 0 if there is not
497673
* enough memory to allocate the event.
@@ -2395,6 +2571,7 @@ class EventQueue : private mbed::NonCopyable<EventQueue> {
23952571
*/
23962572
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>
23972573
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);
2574+
#endif
23982575

23992576
protected:
24002577
template <typename F>

0 commit comments

Comments
 (0)