Mistake on this page?
Report an issue in GitHub or email us
EventQueue.h
1 /* events
2  * Copyright (c) 2016 ARM Limited
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef EVENT_QUEUE_H
19 #define EVENT_QUEUE_H
20 
21 #include "equeue/equeue.h"
22 #include "platform/Callback.h"
23 #include "platform/NonCopyable.h"
24 #include <cstddef>
25 #include <new>
26 
27 namespace events {
28 /** \addtogroup events */
29 
30 /** EVENTS_EVENT_SIZE
31  * Minimum size of an event
32  * This size fits a Callback<void()> at minimum
33  */
34 #define EVENTS_EVENT_SIZE \
35  (EQUEUE_EVENT_SIZE - 2*sizeof(void*) + sizeof(mbed::Callback<void()>))
36 
37 /** EVENTS_QUEUE_SIZE
38  * Default size of buffer for events
39  */
40 #define EVENTS_QUEUE_SIZE (32*EVENTS_EVENT_SIZE)
41 
42 // Predeclared classes
43 template <typename F>
44 class Event;
45 
46 
47 /** EventQueue
48  *
49  * Flexible event queue for dispatching events
50  * @ingroup events
51  */
52 class EventQueue : private mbed::NonCopyable<EventQueue> {
53 public:
54  /** Create an EventQueue
55  *
56  * Create an event queue. The event queue either allocates a buffer of
57  * the specified size with malloc or uses the user provided buffer.
58  *
59  * @param size Size of buffer to use for events in bytes
60  * (default to EVENTS_QUEUE_SIZE)
61  * @param buffer Pointer to buffer to use for events
62  * (default to NULL)
63  */
64  EventQueue(unsigned size = EVENTS_QUEUE_SIZE, unsigned char *buffer = NULL);
65 
66  /** Destroy an EventQueue
67  */
68  ~EventQueue();
69 
70  /** Dispatch events
71  *
72  * Executes events until the specified milliseconds have passed.
73  * If ms is negative, the dispatch function will dispatch events
74  * indefinitely or until break_dispatch is called on this queue.
75  *
76  * When called with a finite timeout, the dispatch function is guaranteed
77  * to terminate. When called with a timeout of 0, the dispatch function
78  * does not wait and is IRQ safe.
79  *
80  * @param ms Time to wait for events in milliseconds, a negative
81  * value will dispatch events indefinitely
82  * (default to -1)
83  */
84  void dispatch(int ms = -1);
85 
86  /** Dispatch events without a timeout
87  *
88  * This is equivalent to EventQueue::dispatch with no arguments, but
89  * avoids overload ambiguities when passed as a callback.
90  *
91  * @see EventQueue::dispatch
92  */
94  {
95  dispatch();
96  }
97 
98  /** Break out of a running event loop
99  *
100  * Forces the specified event queue's dispatch loop to terminate. Pending
101  * events may finish executing, but no new events will be executed.
102  */
103  void break_dispatch();
104 
105  /** Millisecond counter
106  *
107  * Returns the underlying tick of the event queue represented as the
108  * number of milliseconds that have passed since an arbitrary point in
109  * time. Intentionally overflows to 0 after 2^32-1.
110  *
111  * @return The underlying tick of the event queue in milliseconds
112  */
113  unsigned tick();
114 
115  /** Cancel an in-flight event
116  *
117  * Attempts to cancel an event referenced by the unique id returned from
118  * one of the call functions. It is safe to call cancel after an event
119  * has already been dispatched.
120  *
121  * id must be valid i.e. event must have not finished executing.
122  *
123  * The cancel function is IRQ safe.
124  *
125  * If called while the event queue's dispatch loop is active, the cancel
126  * function does not guarantee that the event will not execute after it
127  * returns, as the event may have already begun executing.
128  *
129  * @param id Unique id of the event
130  */
131  void cancel(int id);
132 
133  /** Query how much time is left for delayed event
134  *
135  * If the event is delayed, this function can be used to query how much time
136  * is left until the event is due to be dispatched.
137  *
138  * id must be valid i.e. event must have not finished executing.
139  *
140  * This function is IRQ safe.
141  *
142  * @param id Unique id of the event
143  *
144  * @return Remaining time in milliseconds or
145  * 0 if event is already due to be dispatched or
146  * is currently executing.
147  * Undefined if id is invalid.
148  *
149  */
150  int time_left(int id);
151 
152  /** Background an event queue onto a single-shot timer-interrupt
153  *
154  * When updated, the event queue will call the provided update function
155  * with a timeout indicating when the queue should be dispatched. A
156  * negative timeout will be passed to the update function when the
157  * timer-interrupt is no longer needed.
158  *
159  * Passing a null function disables the existing update function.
160  *
161  * The background function allows an event queue to take advantage of
162  * hardware timers or other event loops, allowing an event queue to be
163  * ran in the background without consuming the foreground thread.
164  *
165  * @param update Function called to indicate when the queue should be
166  * dispatched
167  */
168  void background(mbed::Callback<void(int)> update);
169 
170  /** Chain an event queue onto another event queue
171  *
172  * After chaining a queue to a target, calling dispatch on the target
173  * queue will also dispatch events from this queue. The queues use
174  * their own buffers and events must be handled independently.
175  *
176  * A null queue as the target will unchain the existing queue.
177  *
178  * The chain function allows multiple event queues to be composed,
179  * sharing the context of a dispatch loop while still being managed
180  * independently
181  *
182  * @param target Queue that will dispatch this queue's events as a
183  * part of its dispatch loop
184  *
185  * @return Zero on success and negative error code value if chaining fails
186  *
187  */
188  int chain(EventQueue *target);
189 
190 
191 
192 #if defined(DOXYGEN_ONLY)
193  /** Calls an event on the queue
194  *
195  * The specified callback will be executed in the context of the event
196  * queue's dispatch loop.
197  *
198  * The call function is IRQ safe and can act as a mechanism for moving
199  * events out of IRQ contexts.
200  *
201  * @param f Function to execute in the context of the dispatch loop
202  * @param args Arguments to pass to the callback
203  * @return A unique id that represents the posted event and can
204  * be passed to cancel, or an id of 0 if there is not
205  * enough memory to allocate the event.
206  * Returned id will remain valid until event has finished
207  * executing.
208  *
209  * @code
210  * #include "mbed.h"
211  *
212  * int main() {
213  * // creates a queue with the default size
214  * EventQueue queue;
215  *
216  * // events are simple callbacks
217  * queue.call(printf, "called immediately\n");
218  *
219  * // the dispatch method executes events
220  * queue.dispatch();
221  * }
222  * @endcode
223  */
224  template <typename F, typename ...Args>
225  int call(F f, Args ...args);
226 
227  /** Calls an event on the queue
228  *
229  * The specified callback is executed in the context of the event
230  * queue's dispatch loop.
231  *
232  * The call function is IRQ safe and can act as a mechanism for moving
233  * events out of IRQ contexts.
234  *
235  * @param obj Object to call with the member function
236  * @param method Member function to execute in the context of the dispatch loop
237  * @param args Arguments to pass to the callback
238  * @return A unique ID that represents the posted event and can
239  * be passed to cancel, or an ID of 0 if there is not
240  * enough memory to allocate the event.
241  * Returned ID remains valid until event has finished
242  * executing.
243  *
244  * @code
245  * #include "mbed.h"
246  *
247  * class EventHandler {
248  * int _id;
249  * public:
250  * EventHandler(int id) : _id(id) { }
251  *
252  * void handler(int c) {
253  * printf("ID: %d Param: %d\r\n", _id, c);
254  * }
255  * };
256  *
257  * int main() {
258  * // creates a queue with the default size
259  * EventQueue queue;
260  *
261  * // Create EventHandler object with state
262  * EventHandler handler_cb(1);
263  *
264  * // events are simple callbacks, call object method
265  * // with provided parameter
266  * queue.call(&handler_cb, &EventHandler::handler, 2);
267  *
268  * // the dispath method executes events
269  * queue.dispatch();
270  * }
271  * @endcode
272  */
273  // AStyle ignore, not handling correctly below
274  // *INDENT-OFF*
275  template <typename T, typename R, typename ...Args>
276  int call(T *obj, R (T::*method)(Args ...args), Args ...args);
277  // *INDENT-ON*
278 
279  /** Calls an event on the queue after a specified delay
280  *
281  * The specified callback is executed in the context of the event
282  * queue's dispatch loop.
283  *
284  * The call_in function is IRQ safe and can act as a mechanism for moving
285  * events out of IRQ contexts.
286  *
287  * @param ms Time to delay in milliseconds
288  * @param args Arguments to pass to the callback
289  * @return A unique ID that represents the posted event and can
290  * be passed to cancel, or an ID of 0 if there is not
291  * enough memory to allocate the event.
292  *
293  * @code
294  * #include "mbed.h"
295  *
296  * int main() {
297  * // creates a queue with the default size
298  * EventQueue queue;
299  *
300  * // events are simple callbacks
301  * queue.call_in(2000, printf, "called in 2 seconds\n");
302  *
303  * // the dispatch methods executes events
304  * queue.dispatch();
305  * }
306  * @endcode
307  */
308  template <typename F, typename ...Args>
309  int call_in(int ms, Args ...args);
310 
311  /** Calls an event on the queue after a specified delay
312  *
313  * The specified callback is executed in the context of the event
314  * queue's dispatch loop.
315  *
316  * The call_in function is IRQ safe and can act as a mechanism for moving
317  * events out of IRQ contexts.
318  *
319  * @param ms Time to delay in milliseconds
320  * @param obj Object to call with the member function
321  * @param method Member function to execute in the context of the dispatch loop
322  * @param args Arguments to pass to the callback
323  * @return A unique ID that represents the posted event and can
324  * be passed to cancel, or an ID of 0 if there is not
325  * enough memory to allocate the event.
326  *
327  * @code
328  * #include "mbed.h"
329  *
330  * class EventHandler {
331  * int _id;
332  * public:
333  * EventHandler(int id) : _id(id) { }
334  *
335  * void handler(int c) {
336  * printf("ID: %d Param: %d\r\n", _id, c);
337  * }
338  * };
339  *
340  * int main() {
341  * // creates a queue with the default size
342  * EventQueue queue;
343  *
344  * // Create EventHandler object with state
345  * EventHandler handler_cb(3);
346  *
347  * // events are simple callbacks, call object method in 2 seconds
348  * // with provided parameter
349  * queue.call_in(2000, &handler_cb, &EventHandler::handler, 4);
350  *
351  * // the dispatch method executes events
352  * queue.dispatch();
353  * }
354  * @endcode
355  */
356  // AStyle ignore, not handling correctly below
357  // *INDENT-OFF*
358  template <typename T, typename R, typename ...Args>
359  int call_in(int ms, T *obj, R (T::*method)(Args ...args), Args ...args);
360  // *INDENT-ON*
361 
362  /** Calls an event on the queue periodically
363  *
364  * @note The first call_every event occurs after the specified delay.
365  * To create a periodic event that fires immediately, @see Event.
366  *
367  * The specified callback is executed in the context of the event
368  * queue's dispatch loop.
369  *
370  * The call_every function is IRQ safe and can act as a mechanism for
371  * moving events out of IRQ contexts.
372  *
373  * @param ms Period of the event in milliseconds
374  * @param f Function to execute in the context of the dispatch loop
375  * @param args Arguments to pass to the callback
376  * @return A unique ID that represents the posted event and can
377  * be passed to cancel, or an ID of 0 if there is not
378  * enough memory to allocate the event.
379  *
380  * @code
381  * #include "mbed.h"
382  *
383  * class EventHandler {
384  * int _id;
385  * public:
386  * EventHandler(int id) : _id(id) { }
387  *
388  * void handler(int c) {
389  * printf("ID: %d Param: %d\r\n", _id, c);
390  * }
391  * };
392  *
393  * int main() {
394  * // creates a queue with the default size
395  * EventQueue queue;
396  *
397  * // events are simple callbacks, call every 2 seconds
398  * queue.call_every(2000, printf, "Calling every 2 seconds\n");
399  *
400  * // the dispatch method executes events
401  * queue.dispatch();
402  * }
403  * @endcode
404  */
405  template <typename F, typename ...Args>
406  int call_every(int ms, F f, Args ...args);
407 
408  /** Calls an event on the queue periodically
409  *
410  * @note The first call_every event occurs after the specified delay.
411  * To create a periodic event that fires immediately, @see Event.
412  *
413  * The specified callback is executed in the context of the event
414  * queue's dispatch loop.
415  *
416  * The call_every function is IRQ safe and can act as a mechanism for
417  * moving events out of IRQ contexts.
418  *
419  * @param ms Period of the event in milliseconds
420  * @param obj Object to call with the member function
421  * @param method Member function to execute in the context of the dispatch loop
422  * @param args Arguments to pass to the callback
423  *
424  * @code
425  * #include "mbed.h"
426  *
427  * class EventHandler {
428  * int _id;
429  * public:
430  * EventHandler(int id) : _id(id) { }
431  *
432  * void handler(int c) {
433  * printf("ID: %d Param: %d\r\n", _id, c);
434  * }
435  * };
436  *
437  * int main() {
438  * // creates a queue with the default size
439  * EventQueue queue;
440  *
441  * // Create EventHandler object with state
442  * EventHandler handler_cb(5);
443  *
444  * // events are simple callbacks, call object method every 2 seconds
445  * // with provided parameter
446  * queue.call_every(2000, &handler_cb, &EventHandler::handler, 6);
447  *
448  * // the dispatch method executes events
449  * queue.dispatch();
450  * }
451  * @endcode
452  */
453  // AStyle ignore, not handling correctly below
454  // *INDENT-OFF*
455  template <typename T, typename R, typename ...Args>
456  int call_every(int ms, T *obj, R (T::*method)(Args ...args), Args ...args);
457  // *INDENT-ON*
458 
459  /** Creates an event bound to the event queue
460  *
461  * Constructs an event bound to the specified event queue. The specified
462  * callback acts as the target for the event and is executed in the
463  * context of the event queue's dispatch loop once posted.
464  *
465  * @param func Function to execute when the event is dispatched
466  * @param args Arguments to pass to the callback
467  * @return Event that dispatches on the specific queue
468  *
469  * @code
470  * #include "mbed.h"
471  *
472  * void handler(int c) {
473  * printf("Param: %d\r\n", c);
474  * }
475  *
476  * int main()
477  * {
478  * EventQueue queue;
479  *
480  * // Create event with parameter
481  * Event<void()> e = queue.event(handler, 1);
482  * e();
483  *
484  * // Create event and post parameter later
485  * Event<void(int)> e2 = queue.event(handler);
486  *
487  * // Post the event with paramter 8
488  * e.post(8);
489  *
490  * // The dispatch method executes events
491  * queue.dispatch();
492  *
493  * e2.post(2);
494  *
495  * queue.dispatch();
496  * }
497  * @endcode
498  */
499  // AStyle ignore, not handling correctly below
500  // *INDENT-OFF*
501  template <typename R, typename ...BoundArgs, typename ...Args>
502  Event<void(Args...)> event(R (*func)(BoundArgs...), Args ...args);
503  // *INDENT-ON*
504 
505  /** Creates an event bound to the event queue
506  *
507  * Constructs an event bound to the specified event queue. The specified
508  * callback acts as the target for the event and is executed in the
509  * context of the event queue's dispatch loop once posted.
510  *
511  * @param obj Object to call with the member function
512  * @param method Member function to execute in the context of the dispatch loop
513  * @param context_args Arguments to pass to the callback
514  * @return Event that dispatches on the specific queue
515  *
516  * @code
517  * #include "mbed.h"
518  *
519  * class EventHandler {
520  * int _id;
521  *
522  * public:
523  * EventHandler(int id) : _id(id) { }
524  *
525  * void handler(int c) {
526  * printf("ID: %d Param: %d\r\n", _id, c);
527  * }
528  * };
529  *
530  * int main()
531  * {
532  * EventQueue queue;
533  *
534  * EventHandler handler_cb(10);
535  *
536  * // Create event on the eventqueue with a method callback
537  * Event<void(int)> e = queue.event(&handler_cb, &EventHandler::handler);
538  *
539  * // Post the event with paramter 8
540  * e.post(11);
541  *
542  * // The dispatch method executes events
543  * queue.dispatch();
544  * }
545  * @endcode
546  */
547  // AStyle ignore, not handling correctly below
548  // *INDENT-OFF*
549  template <typename T, typename R, typename ...BoundArgs, typename ...ContextArgs, typename ...Args>
550  Event<void(Args...)> event(T *obj, R (T::*method)(BoundArgs..., Args...), ContextArgs ...context_args);
551  // *INDENT-ON*
552 
553  /** Creates an event bound to the event queue
554  *
555  * Constructs an event bound to the specified event queue. The specified
556  * callback acts as the target for the event and is executed in the
557  * context of the event queue's dispatch loop once posted.
558  *
559  * @param cb Callback object
560  * @param context_args Arguments to pass to the callback
561  * @return Event that dispatches on the specific queue
562  *
563  * @code
564  * #include "mbed.h"
565  *
566  * void handler(int c) {
567  * printf("Param: %d\r\n", c);
568  * }
569  *
570  * int main()
571  * {
572  * EventQueue queue;
573  * // Create callback object acting as a function
574  * // pointer to handler
575  * Callback<void(int)> cb(handler);
576  *
577  * // Pass the callback object to the eventqueue
578  * Event<void(int)> e = queue.event(cb);
579  *
580  * // Post the event with parameter 8
581  * e.post(9);
582  *
583  * // The dispatch method executes events
584  * q.dispatch();
585  * }
586  * @endcode
587  */
588  template <typename R, typename ...BoundArgs, typename ...ContextArgs, typename ...Args>
589  Event<void(Args...)> event(mbed::Callback<R(BoundArgs..., Args...)> cb, ContextArgs ...context_args);
590 
591 #else
592 
593  /** Calls an event on the queue
594  *
595  * The specified callback is executed in the context of the event
596  * queue's dispatch loop.
597  *
598  * The call function is IRQ safe and can act as a mechanism for moving
599  * events out of IRQ contexts.
600  *
601  * @param f Function to execute in the context of the dispatch loop
602  * @return A unique ID that represents the posted event and can
603  * be passed to cancel, or an ID of 0 if there is not
604  * enough memory to allocate the event.
605  * Returned ID remains valid until event has finished
606  * executing.
607  *
608  * @code
609  * #include "mbed.h"
610  *
611  * int main()
612  * {
613  * EventQueue queue;
614  *
615  * Callback<void(int)> cb(handler);
616  *
617  * // Create event on the eventqueue with a separate callback object
618  * Event<void(int)> e = queue.event(cb);
619  * e.post(1);
620  * queue.dispatch();
621  * }
622  * @endcode
623  */
624  template <typename F>
625  int call(F f)
626  {
627  void *p = equeue_alloc(&_equeue, sizeof(F));
628  if (!p) {
629  return 0;
630  }
631 
632  F *e = new (p) F(f);
633  equeue_event_dtor(e, &EventQueue::function_dtor<F>);
634  return equeue_post(&_equeue, &EventQueue::function_call<F>, e);
635  }
636 
637 
638  /** Calls an event on the queue
639  * @see EventQueue::call
640  * @param f Function to execute in the context of the dispatch loop
641  * @param a0 Argument to pass to the callback
642  */
643  template <typename F, typename A0>
644  int call(F f, A0 a0)
645  {
646  return call(context10<F, A0>(f, a0));
647  }
648 
649  /** Calls an event on the queue
650  * @see EventQueue::call
651  * @param f Function to execute in the context of the dispatch loop
652  * @param a0,a1 Arguments to pass to the callback
653  */
654  template <typename F, typename A0, typename A1>
655  int call(F f, A0 a0, A1 a1)
656  {
657  return call(context20<F, A0, A1>(f, a0, a1));
658  }
659 
660  /** Calls an event on the queue
661  * @see EventQueue::call
662  * @param f Function to execute in the context of the dispatch loop
663  * @param a0,a1,a2 Arguments to pass to the callback
664  */
665  template <typename F, typename A0, typename A1, typename A2>
666  int call(F f, A0 a0, A1 a1, A2 a2)
667  {
668  return call(context30<F, A0, A1, A2>(f, a0, a1, a2));
669  }
670 
671  /** Calls an event on the queue
672  * @see EventQueue::call
673  * @param f Function to execute in the context of the dispatch loop
674  * @param a0,a1,a2,a3 Arguments to pass to the callback
675  */
676  template <typename F, typename A0, typename A1, typename A2, typename A3>
677  int call(F f, A0 a0, A1 a1, A2 a2, A3 a3)
678  {
679  return call(context40<F, A0, A1, A2, A3>(f, a0, a1, a2, a3));
680  }
681 
682  /** Calls an event on the queue
683  * @see EventQueue::call
684  * @param f Function to execute in the context of the dispatch loop
685  * @param a0,a1,a2,a3,a4 Arguments to pass to the callback
686  */
687  template <typename F, typename A0, typename A1, typename A2, typename A3, typename A4>
688  int call(F f, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)
689  {
690  return call(context50<F, A0, A1, A2, A3, A4>(f, a0, a1, a2, a3, a4));
691  }
692 
693  /** Calls an event on the queue
694  * @see EventQueue::call
695  */
696  template <typename T, typename R>
697  int call(T *obj, R(T::*method)())
698  {
699  return call(mbed::callback(obj, method));
700  }
701 
702  /** Calls an event on the queue
703  * @see EventQueue::call
704  */
705  template <typename T, typename R>
706  int call(const T *obj, R(T::*method)() const)
707  {
708  return call(mbed::callback(obj, method));
709  }
710 
711  /** Calls an event on the queue
712  * @see EventQueue::call
713  */
714  template <typename T, typename R>
715  int call(volatile T *obj, R(T::*method)() volatile)
716  {
717  return call(mbed::callback(obj, method));
718  }
719 
720  /** Calls an event on the queue
721  * @see EventQueue::call
722  */
723  template <typename T, typename R>
724  int call(const volatile T *obj, R(T::*method)() const volatile)
725  {
726  return call(mbed::callback(obj, method));
727  }
728 
729  /** Calls an event on the queue
730  * @see EventQueue::call
731  */
732  template <typename T, typename R, typename A0>
733  int call(T *obj, R(T::*method)(A0), A0 a0)
734  {
735  return call(mbed::callback(obj, method), a0);
736  }
737 
738  /** Calls an event on the queue
739  * @see EventQueue::call
740  */
741  template <typename T, typename R, typename A0>
742  int call(const T *obj, R(T::*method)(A0) const, A0 a0)
743  {
744  return call(mbed::callback(obj, method), a0);
745  }
746 
747  /** Calls an event on the queue
748  * @see EventQueue::call
749  */
750  template <typename T, typename R, typename A0>
751  int call(volatile T *obj, R(T::*method)(A0) volatile, A0 a0)
752  {
753  return call(mbed::callback(obj, method), a0);
754  }
755 
756  /** Calls an event on the queue
757  * @see EventQueue::call
758  */
759  template <typename T, typename R, typename A0>
760  int call(const volatile T *obj, R(T::*method)(A0) const volatile, A0 a0)
761  {
762  return call(mbed::callback(obj, method), a0);
763  }
764 
765  /** Calls an event on the queue
766  * @see EventQueue::call
767  */
768  template <typename T, typename R, typename A0, typename A1>
769  int call(T *obj, R(T::*method)(A0, A1), A0 a0, A1 a1)
770  {
771  return call(mbed::callback(obj, method), a0, a1);
772  }
773 
774  /** Calls an event on the queue
775  * @see EventQueue::call
776  */
777  template <typename T, typename R, typename A0, typename A1>
778  int call(const T *obj, R(T::*method)(A0, A1) const, A0 a0, A1 a1)
779  {
780  return call(mbed::callback(obj, method), a0, a1);
781  }
782 
783  /** Calls an event on the queue
784  * @see EventQueue::call
785  */
786  template <typename T, typename R, typename A0, typename A1>
787  int call(volatile T *obj, R(T::*method)(A0, A1) volatile, A0 a0, A1 a1)
788  {
789  return call(mbed::callback(obj, method), a0, a1);
790  }
791 
792  /** Calls an event on the queue
793  * @see EventQueue::call
794  */
795  template <typename T, typename R, typename A0, typename A1>
796  int call(const volatile T *obj, R(T::*method)(A0, A1) const volatile, A0 a0, A1 a1)
797  {
798  return call(mbed::callback(obj, method), a0, a1);
799  }
800 
801  /** Calls an event on the queue
802  * @see EventQueue::call
803  */
804  template <typename T, typename R, typename A0, typename A1, typename A2>
805  int call(T *obj, R(T::*method)(A0, A1, A2), A0 a0, A1 a1, A2 a2)
806  {
807  return call(mbed::callback(obj, method), a0, a1, a2);
808  }
809 
810  /** Calls an event on the queue
811  * @see EventQueue::call
812  */
813  template <typename T, typename R, typename A0, typename A1, typename A2>
814  int call(const T *obj, R(T::*method)(A0, A1, A2) const, A0 a0, A1 a1, A2 a2)
815  {
816  return call(mbed::callback(obj, method), a0, a1, a2);
817  }
818 
819  /** Calls an event on the queue
820  * @see EventQueue::call
821  */
822  template <typename T, typename R, typename A0, typename A1, typename A2>
823  int call(volatile T *obj, R(T::*method)(A0, A1, A2) volatile, A0 a0, A1 a1, A2 a2)
824  {
825  return call(mbed::callback(obj, method), a0, a1, a2);
826  }
827 
828  /** Calls an event on the queue
829  * @see EventQueue::call
830  */
831  template <typename T, typename R, typename A0, typename A1, typename A2>
832  int call(const volatile T *obj, R(T::*method)(A0, A1, A2) const volatile, A0 a0, A1 a1, A2 a2)
833  {
834  return call(mbed::callback(obj, method), a0, a1, a2);
835  }
836 
837  /** Calls an event on the queue
838  * @see EventQueue::call
839  */
840  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3>
841  int call(T *obj, R(T::*method)(A0, A1, A2, A3), A0 a0, A1 a1, A2 a2, A3 a3)
842  {
843  return call(mbed::callback(obj, method), a0, a1, a2, a3);
844  }
845 
846  /** Calls an event on the queue
847  * @see EventQueue::call
848  */
849  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3>
850  int call(const T *obj, R(T::*method)(A0, A1, A2, A3) const, A0 a0, A1 a1, A2 a2, A3 a3)
851  {
852  return call(mbed::callback(obj, method), a0, a1, a2, a3);
853  }
854 
855  /** Calls an event on the queue
856  * @see EventQueue::call
857  */
858  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3>
859  int call(volatile T *obj, R(T::*method)(A0, A1, A2, A3) volatile, A0 a0, A1 a1, A2 a2, A3 a3)
860  {
861  return call(mbed::callback(obj, method), a0, a1, a2, a3);
862  }
863 
864  /** Calls an event on the queue
865  * @see EventQueue::call
866  */
867  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3>
868  int call(const volatile T *obj, R(T::*method)(A0, A1, A2, A3) const volatile, A0 a0, A1 a1, A2 a2, A3 a3)
869  {
870  return call(mbed::callback(obj, method), a0, a1, a2, a3);
871  }
872 
873  /** Calls an event on the queue
874  * @see EventQueue::call
875  */
876  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
877  int call(T *obj, R(T::*method)(A0, A1, A2, A3, A4), A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)
878  {
879  return call(mbed::callback(obj, method), a0, a1, a2, a3, a4);
880  }
881 
882  /** Calls an event on the queue
883  * @see EventQueue::call
884  */
885  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
886  int call(const T *obj, R(T::*method)(A0, A1, A2, A3, A4) const, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)
887  {
888  return call(mbed::callback(obj, method), a0, a1, a2, a3, a4);
889  }
890 
891  /** Calls an event on the queue
892  * @see EventQueue::call
893  */
894  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
895  int call(volatile T *obj, R(T::*method)(A0, A1, A2, A3, A4) volatile, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)
896  {
897  return call(mbed::callback(obj, method), a0, a1, a2, a3, a4);
898  }
899 
900  /** Calls an event on the queue
901  * @see EventQueue::call
902  */
903  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
904  int call(const volatile T *obj, R(T::*method)(A0, A1, A2, A3, A4) const volatile, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)
905  {
906  return call(mbed::callback(obj, method), a0, a1, a2, a3, a4);
907  }
908 
909  /** Calls an event on the queue after a specified delay
910  *
911  * The specified callback will be executed in the context of the event
912  * queue's dispatch loop.
913  *
914  * The call_in function is IRQ safe and can act as a mechanism for moving
915  * events out of IRQ contexts.
916  *
917  * @param ms Time to delay in milliseconds
918  * @param f Function to execute in the context of the dispatch loop
919  * @return A unique id that represents the posted event and can
920  * be passed to cancel, or an id of 0 if there is not
921  * enough memory to allocate the event.
922  */
923  template <typename F>
924  int call_in(int ms, F f)
925  {
926  void *p = equeue_alloc(&_equeue, sizeof(F));
927  if (!p) {
928  return 0;
929  }
930 
931  F *e = new (p) F(f);
932  equeue_event_delay(e, ms);
933  equeue_event_dtor(e, &EventQueue::function_dtor<F>);
934  return equeue_post(&_equeue, &EventQueue::function_call<F>, e);
935  }
936 
937  /** Calls an event on the queue after a specified delay
938  * @see EventQueue::call_in
939  * @param ms Time to delay in milliseconds
940  * @param f Function to execute in the context of the dispatch loop
941  * @param a0 Argument to pass to the callback
942  */
943  template <typename F, typename A0>
944  int call_in(int ms, F f, A0 a0)
945  {
946  return call_in(ms, context10<F, A0>(f, a0));
947  }
948 
949  /** Calls an event on the queue after a specified delay
950  * @see EventQueue::call_in
951  * @param ms Time to delay in milliseconds
952  * @param f Function to execute in the context of the dispatch loop
953  * @param a0,a1 Arguments to pass to the callback
954  */
955  template <typename F, typename A0, typename A1>
956  int call_in(int ms, F f, A0 a0, A1 a1)
957  {
958  return call_in(ms, context20<F, A0, A1>(f, a0, a1));
959  }
960 
961  /** Calls an event on the queue after a specified delay
962  * @see EventQueue::call_in
963  * @param ms Time to delay in milliseconds
964  * @param f Function to execute in the context of the dispatch loop
965  * @param a0,a1,a2 Arguments to pass to the callback
966  */
967  template <typename F, typename A0, typename A1, typename A2>
968  int call_in(int ms, F f, A0 a0, A1 a1, A2 a2)
969  {
970  return call_in(ms, context30<F, A0, A1, A2>(f, a0, a1, a2));
971  }
972 
973  /** Calls an event on the queue after a specified delay
974  * @see EventQueue::call_in
975  * @param ms Time to delay in milliseconds
976  * @param f Function to execute in the context of the dispatch loop
977  * @param a0,a1,a2,a3 Arguments to pass to the callback
978  */
979  template <typename F, typename A0, typename A1, typename A2, typename A3>
980  int call_in(int ms, F f, A0 a0, A1 a1, A2 a2, A3 a3)
981  {
982  return call_in(ms, context40<F, A0, A1, A2, A3>(f, a0, a1, a2, a3));
983  }
984 
985  /** Calls an event on the queue after a specified delay
986  * @see EventQueue::call_in
987  * @param ms Time to delay in milliseconds
988  * @param f Function to execute in the context of the dispatch loop
989  * @param a0,a1,a2,a3,a4 Arguments to pass to the callback
990  */
991  template <typename F, typename A0, typename A1, typename A2, typename A3, typename A4>
992  int call_in(int ms, F f, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)
993  {
994  return call_in(ms, context50<F, A0, A1, A2, A3, A4>(f, a0, a1, a2, a3, a4));
995  }
996 
997  /** Calls an event on the queue after a specified delay
998  * @see EventQueue::call_in
999  */
1000  template <typename T, typename R>
1001  int call_in(int ms, T *obj, R(T::*method)())
1002  {
1003  return call_in(ms, mbed::callback(obj, method));
1004  }
1005 
1006  /** Calls an event on the queue after a specified delay
1007  * @see EventQueue::call_in
1008  */
1009  template <typename T, typename R>
1010  int call_in(int ms, const T *obj, R(T::*method)() const)
1011  {
1012  return call_in(ms, mbed::callback(obj, method));
1013  }
1014 
1015  /** Calls an event on the queue after a specified delay
1016  * @see EventQueue::call_in
1017  */
1018  template <typename T, typename R>
1019  int call_in(int ms, volatile T *obj, R(T::*method)() volatile)
1020  {
1021  return call_in(ms, mbed::callback(obj, method));
1022  }
1023 
1024  /** Calls an event on the queue after a specified delay
1025  * @see EventQueue::call_in
1026  */
1027  template <typename T, typename R>
1028  int call_in(int ms, const volatile T *obj, R(T::*method)() const volatile)
1029  {
1030  return call_in(ms, mbed::callback(obj, method));
1031  }
1032 
1033  /** Calls an event on the queue after a specified delay
1034  * @see EventQueue::call_in
1035  */
1036  template <typename T, typename R, typename A0>
1037  int call_in(int ms, T *obj, R(T::*method)(A0), A0 a0)
1038  {
1039  return call_in(ms, mbed::callback(obj, method), a0);
1040  }
1041 
1042  /** Calls an event on the queue after a specified delay
1043  * @see EventQueue::call_in
1044  */
1045  template <typename T, typename R, typename A0>
1046  int call_in(int ms, const T *obj, R(T::*method)(A0) const, A0 a0)
1047  {
1048  return call_in(ms, mbed::callback(obj, method), a0);
1049  }
1050 
1051  /** Calls an event on the queue after a specified delay
1052  * @see EventQueue::call_in
1053  */
1054  template <typename T, typename R, typename A0>
1055  int call_in(int ms, volatile T *obj, R(T::*method)(A0) volatile, A0 a0)
1056  {
1057  return call_in(ms, mbed::callback(obj, method), a0);
1058  }
1059 
1060  /** Calls an event on the queue after a specified delay
1061  * @see EventQueue::call_in
1062  */
1063  template <typename T, typename R, typename A0>
1064  int call_in(int ms, const volatile T *obj, R(T::*method)(A0) const volatile, A0 a0)
1065  {
1066  return call_in(ms, mbed::callback(obj, method), a0);
1067  }
1068 
1069  /** Calls an event on the queue after a specified delay
1070  * @see EventQueue::call_in
1071  */
1072  template <typename T, typename R, typename A0, typename A1>
1073  int call_in(int ms, T *obj, R(T::*method)(A0, A1), A0 a0, A1 a1)
1074  {
1075  return call_in(ms, mbed::callback(obj, method), a0, a1);
1076  }
1077 
1078  /** Calls an event on the queue after a specified delay
1079  * @see EventQueue::call_in
1080  */
1081  template <typename T, typename R, typename A0, typename A1>
1082  int call_in(int ms, const T *obj, R(T::*method)(A0, A1) const, A0 a0, A1 a1)
1083  {
1084  return call_in(ms, mbed::callback(obj, method), a0, a1);
1085  }
1086 
1087  /** Calls an event on the queue after a specified delay
1088  * @see EventQueue::call_in
1089  */
1090  template <typename T, typename R, typename A0, typename A1>
1091  int call_in(int ms, volatile T *obj, R(T::*method)(A0, A1) volatile, A0 a0, A1 a1)
1092  {
1093  return call_in(ms, mbed::callback(obj, method), a0, a1);
1094  }
1095 
1096  /** Calls an event on the queue after a specified delay
1097  * @see EventQueue::call_in
1098  */
1099  template <typename T, typename R, typename A0, typename A1>
1100  int call_in(int ms, const volatile T *obj, R(T::*method)(A0, A1) const volatile, A0 a0, A1 a1)
1101  {
1102  return call_in(ms, mbed::callback(obj, method), a0, a1);
1103  }
1104 
1105  /** Calls an event on the queue after a specified delay
1106  * @see EventQueue::call_in
1107  */
1108  template <typename T, typename R, typename A0, typename A1, typename A2>
1109  int call_in(int ms, T *obj, R(T::*method)(A0, A1, A2), A0 a0, A1 a1, A2 a2)
1110  {
1111  return call_in(ms, mbed::callback(obj, method), a0, a1, a2);
1112  }
1113 
1114  /** Calls an event on the queue after a specified delay
1115  * @see EventQueue::call_in
1116  */
1117  template <typename T, typename R, typename A0, typename A1, typename A2>
1118  int call_in(int ms, const T *obj, R(T::*method)(A0, A1, A2) const, A0 a0, A1 a1, A2 a2)
1119  {
1120  return call_in(ms, mbed::callback(obj, method), a0, a1, a2);
1121  }
1122 
1123  /** Calls an event on the queue after a specified delay
1124  * @see EventQueue::call_in
1125  */
1126  template <typename T, typename R, typename A0, typename A1, typename A2>
1127  int call_in(int ms, volatile T *obj, R(T::*method)(A0, A1, A2) volatile, A0 a0, A1 a1, A2 a2)
1128  {
1129  return call_in(ms, mbed::callback(obj, method), a0, a1, a2);
1130  }
1131 
1132  /** Calls an event on the queue after a specified delay
1133  * @see EventQueue::call_in
1134  */
1135  template <typename T, typename R, typename A0, typename A1, typename A2>
1136  int call_in(int ms, const volatile T *obj, R(T::*method)(A0, A1, A2) const volatile, A0 a0, A1 a1, A2 a2)
1137  {
1138  return call_in(ms, mbed::callback(obj, method), a0, a1, a2);
1139  }
1140 
1141  /** Calls an event on the queue after a specified delay
1142  * @see EventQueue::call_in
1143  */
1144  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3>
1145  int call_in(int ms, T *obj, R(T::*method)(A0, A1, A2, A3), A0 a0, A1 a1, A2 a2, A3 a3)
1146  {
1147  return call_in(ms, mbed::callback(obj, method), a0, a1, a2, a3);
1148  }
1149 
1150  /** Calls an event on the queue after a specified delay
1151  * @see EventQueue::call_in
1152  */
1153  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3>
1154  int call_in(int ms, const T *obj, R(T::*method)(A0, A1, A2, A3) const, A0 a0, A1 a1, A2 a2, A3 a3)
1155  {
1156  return call_in(ms, mbed::callback(obj, method), a0, a1, a2, a3);
1157  }
1158 
1159  /** Calls an event on the queue after a specified delay
1160  * @see EventQueue::call_in
1161  */
1162  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3>
1163  int call_in(int ms, volatile T *obj, R(T::*method)(A0, A1, A2, A3) volatile, A0 a0, A1 a1, A2 a2, A3 a3)
1164  {
1165  return call_in(ms, mbed::callback(obj, method), a0, a1, a2, a3);
1166  }
1167 
1168  /** Calls an event on the queue after a specified delay
1169  * @see EventQueue::call_in
1170  */
1171  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3>
1172  int call_in(int ms, const volatile T *obj, R(T::*method)(A0, A1, A2, A3) const volatile, A0 a0, A1 a1, A2 a2, A3 a3)
1173  {
1174  return call_in(ms, mbed::callback(obj, method), a0, a1, a2, a3);
1175  }
1176 
1177  /** Calls an event on the queue after a specified delay
1178  * @see EventQueue::call_in
1179  */
1180  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
1181  int call_in(int ms, T *obj, R(T::*method)(A0, A1, A2, A3, A4), A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)
1182  {
1183  return call_in(ms, mbed::callback(obj, method), a0, a1, a2, a3, a4);
1184  }
1185 
1186  /** Calls an event on the queue after a specified delay
1187  * @see EventQueue::call_in
1188  */
1189  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
1190  int call_in(int ms, const T *obj, R(T::*method)(A0, A1, A2, A3, A4) const, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)
1191  {
1192  return call_in(ms, mbed::callback(obj, method), a0, a1, a2, a3, a4);
1193  }
1194 
1195  /** Calls an event on the queue after a specified delay
1196  * @see EventQueue::call_in
1197  */
1198  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
1199  int call_in(int ms, volatile T *obj, R(T::*method)(A0, A1, A2, A3, A4) volatile, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)
1200  {
1201  return call_in(ms, mbed::callback(obj, method), a0, a1, a2, a3, a4);
1202  }
1203 
1204  /** Calls an event on the queue after a specified delay
1205  * @see EventQueue::call_in
1206  */
1207  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
1208  int call_in(int ms, const volatile T *obj, R(T::*method)(A0, A1, A2, A3, A4) const volatile, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)
1209  {
1210  return call_in(ms, mbed::callback(obj, method), a0, a1, a2, a3, a4);
1211  }
1212 
1213  /** Calls an event on the queue periodically
1214  *
1215  * @note The first call_every event occurs after the specified delay.
1216  * To create a periodic event that fires immediately, @see Event.
1217  *
1218  * The specified callback will be executed in the context of the event
1219  * queue's dispatch loop.
1220  *
1221  * The call_every function is IRQ safe and can act as a mechanism for
1222  * moving events out of IRQ contexts.
1223  *
1224  * @param f Function to execute in the context of the dispatch loop
1225  * @param ms Period of the event in milliseconds
1226  * @return A unique id that represents the posted event and can
1227  * be passed to cancel, or an id of 0 if there is not
1228  * enough memory to allocate the event.
1229  */
1230  template <typename F>
1231  int call_every(int ms, F f)
1232  {
1233  void *p = equeue_alloc(&_equeue, sizeof(F));
1234  if (!p) {
1235  return 0;
1236  }
1237 
1238  F *e = new (p) F(f);
1239  equeue_event_delay(e, ms);
1240  equeue_event_period(e, ms);
1241  equeue_event_dtor(e, &EventQueue::function_dtor<F>);
1242  return equeue_post(&_equeue, &EventQueue::function_call<F>, e);
1243  }
1244 
1245  /** Calls an event on the queue periodically
1246  * @see EventQueue::call_every
1247  * @param f Function to execute in the context of the dispatch loop
1248  * @param a0 Argument to pass to the callback
1249  * @param ms Period of the event in milliseconds
1250  */
1251  template <typename F, typename A0>
1252  int call_every(int ms, F f, A0 a0)
1253  {
1254  return call_every(ms, context10<F, A0>(f, a0));
1255  }
1256 
1257  /** Calls an event on the queue periodically
1258  * @see EventQueue::call_every
1259  * @param f Function to execute in the context of the dispatch loop
1260  * @param a0,a1 Arguments to pass to the callback
1261  * @param ms Period of the event in milliseconds
1262  */
1263  template <typename F, typename A0, typename A1>
1264  int call_every(int ms, F f, A0 a0, A1 a1)
1265  {
1266  return call_every(ms, context20<F, A0, A1>(f, a0, a1));
1267  }
1268 
1269  /** Calls an event on the queue periodically
1270  * @see EventQueue::call_every
1271  * @param f Function to execute in the context of the dispatch loop
1272  * @param a0,a1,a2 Arguments to pass to the callback
1273  * @param ms Period of the event in milliseconds
1274  */
1275  template <typename F, typename A0, typename A1, typename A2>
1276  int call_every(int ms, F f, A0 a0, A1 a1, A2 a2)
1277  {
1278  return call_every(ms, context30<F, A0, A1, A2>(f, a0, a1, a2));
1279  }
1280 
1281  /** Calls an event on the queue periodically
1282  * @see EventQueue::call_every
1283  * @param f Function to execute in the context of the dispatch loop
1284  * @param a0,a1,a2,a3 Arguments to pass to the callback
1285  * @param ms Period of the event in milliseconds
1286  */
1287  template <typename F, typename A0, typename A1, typename A2, typename A3>
1288  int call_every(int ms, F f, A0 a0, A1 a1, A2 a2, A3 a3)
1289  {
1290  return call_every(ms, context40<F, A0, A1, A2, A3>(f, a0, a1, a2, a3));
1291  }
1292 
1293  /** Calls an event on the queue periodically
1294  * @see EventQueue::call_every
1295  * @param f Function to execute in the context of the dispatch loop
1296  * @param a0,a1,a2,a3,a4 Arguments to pass to the callback
1297  * @param ms Period of the event in milliseconds
1298  */
1299  template <typename F, typename A0, typename A1, typename A2, typename A3, typename A4>
1300  int call_every(int ms, F f, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)
1301  {
1302  return call_every(ms, context50<F, A0, A1, A2, A3, A4>(f, a0, a1, a2, a3, a4));
1303  }
1304 
1305  /** Calls an event on the queue periodically
1306  * @see EventQueue::call_every
1307  */
1308  template <typename T, typename R>
1309  int call_every(int ms, T *obj, R(T::*method)())
1310  {
1311  return call_every(ms, mbed::callback(obj, method));
1312  }
1313 
1314  /** Calls an event on the queue periodically
1315  * @see EventQueue::call_every
1316  */
1317  template <typename T, typename R>
1318  int call_every(int ms, const T *obj, R(T::*method)() const)
1319  {
1320  return call_every(ms, mbed::callback(obj, method));
1321  }
1322 
1323  /** Calls an event on the queue periodically
1324  * @see EventQueue::call_every
1325  */
1326  template <typename T, typename R>
1327  int call_every(int ms, volatile T *obj, R(T::*method)() volatile)
1328  {
1329  return call_every(ms, mbed::callback(obj, method));
1330  }
1331 
1332  /** Calls an event on the queue periodically
1333  * @see EventQueue::call_every
1334  */
1335  template <typename T, typename R>
1336  int call_every(int ms, const volatile T *obj, R(T::*method)() const volatile)
1337  {
1338  return call_every(ms, mbed::callback(obj, method));
1339  }
1340 
1341  /** Calls an event on the queue periodically
1342  * @see EventQueue::call_every
1343  */
1344  template <typename T, typename R, typename A0>
1345  int call_every(int ms, T *obj, R(T::*method)(A0), A0 a0)
1346  {
1347  return call_every(ms, mbed::callback(obj, method), a0);
1348  }
1349 
1350  /** Calls an event on the queue periodically
1351  * @see EventQueue::call_every
1352  */
1353  template <typename T, typename R, typename A0>
1354  int call_every(int ms, const T *obj, R(T::*method)(A0) const, A0 a0)
1355  {
1356  return call_every(ms, mbed::callback(obj, method), a0);
1357  }
1358 
1359  /** Calls an event on the queue periodically
1360  * @see EventQueue::call_every
1361  */
1362  template <typename T, typename R, typename A0>
1363  int call_every(int ms, volatile T *obj, R(T::*method)(A0) volatile, A0 a0)
1364  {
1365  return call_every(ms, mbed::callback(obj, method), a0);
1366  }
1367 
1368  /** Calls an event on the queue periodically
1369  * @see EventQueue::call_every
1370  */
1371  template <typename T, typename R, typename A0>
1372  int call_every(int ms, const volatile T *obj, R(T::*method)(A0) const volatile, A0 a0)
1373  {
1374  return call_every(ms, mbed::callback(obj, method), a0);
1375  }
1376 
1377  /** Calls an event on the queue periodically
1378  * @see EventQueue::call_every
1379  */
1380  template <typename T, typename R, typename A0, typename A1>
1381  int call_every(int ms, T *obj, R(T::*method)(A0, A1), A0 a0, A1 a1)
1382  {
1383  return call_every(ms, mbed::callback(obj, method), a0, a1);
1384  }
1385 
1386  /** Calls an event on the queue periodically
1387  * @see EventQueue::call_every
1388  */
1389  template <typename T, typename R, typename A0, typename A1>
1390  int call_every(int ms, const T *obj, R(T::*method)(A0, A1) const, A0 a0, A1 a1)
1391  {
1392  return call_every(ms, mbed::callback(obj, method), a0, a1);
1393  }
1394 
1395  /** Calls an event on the queue periodically
1396  * @see EventQueue::call_every
1397  */
1398  template <typename T, typename R, typename A0, typename A1>
1399  int call_every(int ms, volatile T *obj, R(T::*method)(A0, A1) volatile, A0 a0, A1 a1)
1400  {
1401  return call_every(ms, mbed::callback(obj, method), a0, a1);
1402  }
1403 
1404  /** Calls an event on the queue periodically
1405  * @see EventQueue::call_every
1406  */
1407  template <typename T, typename R, typename A0, typename A1>
1408  int call_every(int ms, const volatile T *obj, R(T::*method)(A0, A1) const volatile, A0 a0, A1 a1)
1409  {
1410  return call_every(ms, mbed::callback(obj, method), a0, a1);
1411  }
1412 
1413  /** Calls an event on the queue periodically
1414  * @see EventQueue::call_every
1415  */
1416  template <typename T, typename R, typename A0, typename A1, typename A2>
1417  int call_every(int ms, T *obj, R(T::*method)(A0, A1, A2), A0 a0, A1 a1, A2 a2)
1418  {
1419  return call_every(ms, mbed::callback(obj, method), a0, a1, a2);
1420  }
1421 
1422  /** Calls an event on the queue periodically
1423  * @see EventQueue::call_every
1424  */
1425  template <typename T, typename R, typename A0, typename A1, typename A2>
1426  int call_every(int ms, const T *obj, R(T::*method)(A0, A1, A2) const, A0 a0, A1 a1, A2 a2)
1427  {
1428  return call_every(ms, mbed::callback(obj, method), a0, a1, a2);
1429  }
1430 
1431  /** Calls an event on the queue periodically
1432  * @see EventQueue::call_every
1433  */
1434  template <typename T, typename R, typename A0, typename A1, typename A2>
1435  int call_every(int ms, volatile T *obj, R(T::*method)(A0, A1, A2) volatile, A0 a0, A1 a1, A2 a2)
1436  {
1437  return call_every(ms, mbed::callback(obj, method), a0, a1, a2);
1438  }
1439 
1440  /** Calls an event on the queue periodically
1441  * @see EventQueue::call_every
1442  */
1443  template <typename T, typename R, typename A0, typename A1, typename A2>
1444  int call_every(int ms, const volatile T *obj, R(T::*method)(A0, A1, A2) const volatile, A0 a0, A1 a1, A2 a2)
1445  {
1446  return call_every(ms, mbed::callback(obj, method), a0, a1, a2);
1447  }
1448 
1449  /** Calls an event on the queue periodically
1450  * @see EventQueue::call_every
1451  */
1452  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3>
1453  int call_every(int ms, T *obj, R(T::*method)(A0, A1, A2, A3), A0 a0, A1 a1, A2 a2, A3 a3)
1454  {
1455  return call_every(ms, mbed::callback(obj, method), a0, a1, a2, a3);
1456  }
1457 
1458  /** Calls an event on the queue periodically
1459  * @see EventQueue::call_every
1460  */
1461  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3>
1462  int call_every(int ms, const T *obj, R(T::*method)(A0, A1, A2, A3) const, A0 a0, A1 a1, A2 a2, A3 a3)
1463  {
1464  return call_every(ms, mbed::callback(obj, method), a0, a1, a2, a3);
1465  }
1466 
1467  /** Calls an event on the queue periodically
1468  * @see EventQueue::call_every
1469  */
1470  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3>
1471  int call_every(int ms, volatile T *obj, R(T::*method)(A0, A1, A2, A3) volatile, A0 a0, A1 a1, A2 a2, A3 a3)
1472  {
1473  return call_every(ms, mbed::callback(obj, method), a0, a1, a2, a3);
1474  }
1475 
1476  /** Calls an event on the queue periodically
1477  * @see EventQueue::call_every
1478  */
1479  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3>
1480  int call_every(int ms, const volatile T *obj, R(T::*method)(A0, A1, A2, A3) const volatile, A0 a0, A1 a1, A2 a2, A3 a3)
1481  {
1482  return call_every(ms, mbed::callback(obj, method), a0, a1, a2, a3);
1483  }
1484 
1485  /** Calls an event on the queue periodically
1486  * @see EventQueue::call_every
1487  */
1488  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
1489  int call_every(int ms, T *obj, R(T::*method)(A0, A1, A2, A3, A4), A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)
1490  {
1491  return call_every(ms, mbed::callback(obj, method), a0, a1, a2, a3, a4);
1492  }
1493 
1494  /** Calls an event on the queue periodically
1495  * @see EventQueue::call_every
1496  */
1497  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
1498  int call_every(int ms, const T *obj, R(T::*method)(A0, A1, A2, A3, A4) const, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)
1499  {
1500  return call_every(ms, mbed::callback(obj, method), a0, a1, a2, a3, a4);
1501  }
1502 
1503  /** Calls an event on the queue periodically
1504  * @see EventQueue::call_every
1505  */
1506  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
1507  int call_every(int ms, volatile T *obj, R(T::*method)(A0, A1, A2, A3, A4) volatile, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)
1508  {
1509  return call_every(ms, mbed::callback(obj, method), a0, a1, a2, a3, a4);
1510  }
1511 
1512  /** Calls an event on the queue periodically
1513  * @see EventQueue::call_every
1514  */
1515  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
1516  int call_every(int ms, const volatile T *obj, R(T::*method)(A0, A1, A2, A3, A4) const volatile, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)
1517  {
1518  return call_every(ms, mbed::callback(obj, method), a0, a1, a2, a3, a4);
1519  }
1520 
1521  /** Creates an event bound to the event queue
1522  *
1523  * Constructs an event bound to the specified event queue. The specified
1524  * callback acts as the target for the event and is executed in the
1525  * context of the event queue's dispatch loop once posted.
1526  *
1527  * @param func Function to execute when the event is dispatched
1528  * @return Event that will dispatch on the specific queue
1529  */
1530  template <typename R>
1531  Event<void()> event(R(*func)());
1532 
1533  /** Creates an event bound to the event queue
1534  * @see EventQueue::event
1535  */
1536  template <typename T, typename R>
1537  Event<void()> event(T *obj, R(T::*method)());
1538 
1539  /** Creates an event bound to the event queue
1540  * @see EventQueue::event
1541  */
1542  template <typename T, typename R>
1543  Event<void()> event(const T *obj, R(T::*method)() const);
1544 
1545  /** Creates an event bound to the event queue
1546  * @see EventQueue::event
1547  */
1548  template <typename T, typename R>
1549  Event<void()> event(volatile T *obj, R(T::*method)() volatile);
1550 
1551  /** Creates an event bound to the event queue
1552  * @see EventQueue::event
1553  */
1554  template <typename T, typename R>
1555  Event<void()> event(const volatile T *obj, R(T::*method)() const volatile);
1556 
1557  /** Creates an event bound to the event queue
1558  * @see EventQueue::event
1559  */
1560  template <typename R>
1562 
1563  /** Creates an event bound to the event queue
1564  * @see EventQueue::event
1565  */
1566  template <typename R, typename B0, typename C0>
1567  Event<void()> event(R(*func)(B0), C0 c0);
1568 
1569  /** Creates an event bound to the event queue
1570  * @see EventQueue::event
1571  */
1572  template <typename T, typename R, typename B0, typename C0>
1573  Event<void()> event(T *obj, R(T::*method)(B0), C0 c0);
1574 
1575  /** Creates an event bound to the event queue
1576  * @see EventQueue::event
1577  */
1578  template <typename T, typename R, typename B0, typename C0>
1579  Event<void()> event(const T *obj, R(T::*method)(B0) const, C0 c0);
1580 
1581  /** Creates an event bound to the event queue
1582  * @see EventQueue::event
1583  */
1584  template <typename T, typename R, typename B0, typename C0>
1585  Event<void()> event(volatile T *obj, R(T::*method)(B0) volatile, C0 c0);
1586 
1587  /** Creates an event bound to the event queue
1588  * @see EventQueue::event
1589  */
1590  template <typename T, typename R, typename B0, typename C0>
1591  Event<void()> event(const volatile T *obj, R(T::*method)(B0) const volatile, C0 c0);
1592 
1593  /** Creates an event bound to the event queue
1594  * @see EventQueue::event
1595  */
1596  template <typename R, typename B0, typename C0>
1597  Event<void()> event(mbed::Callback<R(B0)> cb, C0 c0);
1598 
1599  /** Creates an event bound to the event queue
1600  * @see EventQueue::event
1601  */
1602  template <typename R, typename B0, typename B1, typename C0, typename C1>
1603  Event<void()> event(R(*func)(B0, B1), C0 c0, C1 c1);
1604 
1605  /** Creates an event bound to the event queue
1606  * @see EventQueue::event
1607  */
1608  template <typename T, typename R, typename B0, typename B1, typename C0, typename C1>
1609  Event<void()> event(T *obj, R(T::*method)(B0, B1), C0 c0, C1 c1);
1610 
1611  /** Creates an event bound to the event queue
1612  * @see EventQueue::event
1613  */
1614  template <typename T, typename R, typename B0, typename B1, typename C0, typename C1>
1615  Event<void()> event(const T *obj, R(T::*method)(B0, B1) const, C0 c0, C1 c1);
1616 
1617  /** Creates an event bound to the event queue
1618  * @see EventQueue::event
1619  */
1620  template <typename T, typename R, typename B0, typename B1, typename C0, typename C1>
1621  Event<void()> event(volatile T *obj, R(T::*method)(B0, B1) volatile, C0 c0, C1 c1);
1622 
1623  /** Creates an event bound to the event queue
1624  * @see EventQueue::event
1625  */
1626  template <typename T, typename R, typename B0, typename B1, typename C0, typename C1>
1627  Event<void()> event(const volatile T *obj, R(T::*method)(B0, B1) const volatile, C0 c0, C1 c1);
1628 
1629  /** Creates an event bound to the event queue
1630  * @see EventQueue::event
1631  */
1632  template <typename R, typename B0, typename B1, typename C0, typename C1>
1633  Event<void()> event(mbed::Callback<R(B0, B1)> cb, C0 c0, C1 c1);
1634 
1635  /** Creates an event bound to the event queue
1636  * @see EventQueue::event
1637  */
1638  template <typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2>
1639  Event<void()> event(R(*func)(B0, B1, B2), C0 c0, C1 c1, C2 c2);
1640 
1641  /** Creates an event bound to the event queue
1642  * @see EventQueue::event
1643  */
1644  template <typename T, typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2>
1645  Event<void()> event(T *obj, R(T::*method)(B0, B1, B2), C0 c0, C1 c1, C2 c2);
1646 
1647  /** Creates an event bound to the event queue
1648  * @see EventQueue::event
1649  */
1650  template <typename T, typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2>
1651  Event<void()> event(const T *obj, R(T::*method)(B0, B1, B2) const, C0 c0, C1 c1, C2 c2);
1652 
1653  /** Creates an event bound to the event queue
1654  * @see EventQueue::event
1655  */
1656  template <typename T, typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2>
1657  Event<void()> event(volatile T *obj, R(T::*method)(B0, B1, B2) volatile, C0 c0, C1 c1, C2 c2);
1658 
1659  /** Creates an event bound to the event queue
1660  * @see EventQueue::event
1661  */
1662  template <typename T, typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2>
1663  Event<void()> event(const volatile T *obj, R(T::*method)(B0, B1, B2) const volatile, C0 c0, C1 c1, C2 c2);
1664 
1665  /** Creates an event bound to the event queue
1666  * @see EventQueue::event
1667  */
1668  template <typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2>
1669  Event<void()> event(mbed::Callback<R(B0, B1, B2)> cb, C0 c0, C1 c1, C2 c2);
1670 
1671  /** Creates an event bound to the event queue
1672  * @see EventQueue::event
1673  */
1674  template <typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3>
1675  Event<void()> event(R(*func)(B0, B1, B2, B3), C0 c0, C1 c1, C2 c2, C3 c3);
1676 
1677  /** Creates an event bound to the event queue
1678  * @see EventQueue::event
1679  */
1680  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3>
1681  Event<void()> event(T *obj, R(T::*method)(B0, B1, B2, B3), C0 c0, C1 c1, C2 c2, C3 c3);
1682 
1683  /** Creates an event bound to the event queue
1684  * @see EventQueue::event
1685  */
1686  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3>
1687  Event<void()> event(const T *obj, R(T::*method)(B0, B1, B2, B3) const, C0 c0, C1 c1, C2 c2, C3 c3);
1688 
1689  /** Creates an event bound to the event queue
1690  * @see EventQueue::event
1691  */
1692  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3>
1693  Event<void()> event(volatile T *obj, R(T::*method)(B0, B1, B2, B3) volatile, C0 c0, C1 c1, C2 c2, C3 c3);
1694 
1695  /** Creates an event bound to the event queue
1696  * @see EventQueue::event
1697  */
1698  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3>
1699  Event<void()> event(const volatile T *obj, R(T::*method)(B0, B1, B2, B3) const volatile, C0 c0, C1 c1, C2 c2, C3 c3);
1700 
1701  /** Creates an event bound to the event queue
1702  * @see EventQueue::event
1703  */
1704  template <typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3>
1705  Event<void()> event(mbed::Callback<R(B0, B1, B2, B3)> cb, C0 c0, C1 c1, C2 c2, C3 c3);
1706 
1707  /** Creates an event bound to the event queue
1708  * @see EventQueue::event
1709  */
1710  template <typename R, typename B0, typename B1, typename B2, typename B3, typename B4, typename C0, typename C1, typename C2, typename C3, typename C4>
1711  Event<void()> event(R(*func)(B0, B1, B2, B3, B4), C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
1712 
1713  /** Creates an event bound to the event queue
1714  * @see EventQueue::event
1715  */
1716  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename B4, typename C0, typename C1, typename C2, typename C3, typename C4>
1717  Event<void()> event(T *obj, R(T::*method)(B0, B1, B2, B3, B4), C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
1718 
1719  /** Creates an event bound to the event queue
1720  * @see EventQueue::event
1721  */
1722  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename B4, typename C0, typename C1, typename C2, typename C3, typename C4>
1723  Event<void()> event(const T *obj, R(T::*method)(B0, B1, B2, B3, B4) const, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
1724 
1725  /** Creates an event bound to the event queue
1726  * @see EventQueue::event
1727  */
1728  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename B4, typename C0, typename C1, typename C2, typename C3, typename C4>
1729  Event<void()> event(volatile T *obj, R(T::*method)(B0, B1, B2, B3, B4) volatile, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
1730 
1731  /** Creates an event bound to the event queue
1732  * @see EventQueue::event
1733  */
1734  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename B4, typename C0, typename C1, typename C2, typename C3, typename C4>
1735  Event<void()> event(const volatile T *obj, R(T::*method)(B0, B1, B2, B3, B4) const volatile, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
1736 
1737  /** Creates an event bound to the event queue
1738  * @see EventQueue::event
1739  */
1740  template <typename R, typename B0, typename B1, typename B2, typename B3, typename B4, typename C0, typename C1, typename C2, typename C3, typename C4>
1741  Event<void()> event(mbed::Callback<R(B0, B1, B2, B3, B4)> cb, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
1742 
1743  /** Creates an event bound to the event queue
1744  * @see EventQueue::event
1745  */
1746  template <typename R, typename A0>
1747  Event<void(A0)> event(R(*func)(A0));
1748 
1749  /** Creates an event bound to the event queue
1750  * @see EventQueue::event
1751  */
1752  template <typename T, typename R, typename A0>
1753  Event<void(A0)> event(T *obj, R(T::*method)(A0));
1754 
1755  /** Creates an event bound to the event queue
1756  * @see EventQueue::event
1757  */
1758  template <typename T, typename R, typename A0>
1759  Event<void(A0)> event(const T *obj, R(T::*method)(A0) const);
1760 
1761  /** Creates an event bound to the event queue
1762  * @see EventQueue::event
1763  */
1764  template <typename T, typename R, typename A0>
1765  Event<void(A0)> event(volatile T *obj, R(T::*method)(A0) volatile);
1766 
1767  /** Creates an event bound to the event queue
1768  * @see EventQueue::event
1769  */
1770  template <typename T, typename R, typename A0>
1771  Event<void(A0)> event(const volatile T *obj, R(T::*method)(A0) const volatile);
1772 
1773  /** Creates an event bound to the event queue
1774  * @see EventQueue::event
1775  */
1776  template <typename R, typename A0>
1778 
1779  /** Creates an event bound to the event queue
1780  * @see EventQueue::event
1781  */
1782  template <typename R, typename B0, typename C0, typename A0>
1783  Event<void(A0)> event(R(*func)(B0, A0), C0 c0);
1784 
1785  /** Creates an event bound to the event queue
1786  * @see EventQueue::event
1787  */
1788  template <typename T, typename R, typename B0, typename C0, typename A0>
1789  Event<void(A0)> event(T *obj, R(T::*method)(B0, A0), C0 c0);
1790 
1791  /** Creates an event bound to the event queue
1792  * @see EventQueue::event
1793  */
1794  template <typename T, typename R, typename B0, typename C0, typename A0>
1795  Event<void(A0)> event(const T *obj, R(T::*method)(B0, A0) const, C0 c0);
1796 
1797  /** Creates an event bound to the event queue
1798  * @see EventQueue::event
1799  */
1800  template <typename T, typename R, typename B0, typename C0, typename A0>
1801  Event<void(A0)> event(volatile T *obj, R(T::*method)(B0, A0) volatile, C0 c0);
1802 
1803  /** Creates an event bound to the event queue
1804  * @see EventQueue::event
1805  */
1806  template <typename T, typename R, typename B0, typename C0, typename A0>
1807  Event<void(A0)> event(const volatile T *obj, R(T::*method)(B0, A0) const volatile, C0 c0);
1808 
1809  /** Creates an event bound to the event queue
1810  * @see EventQueue::event
1811  */
1812  template <typename R, typename B0, typename C0, typename A0>
1813  Event<void(A0)> event(mbed::Callback<R(B0, A0)> cb, C0 c0);
1814 
1815  /** Creates an event bound to the event queue
1816  * @see EventQueue::event
1817  */
1818  template <typename R, typename B0, typename B1, typename C0, typename C1, typename A0>
1819  Event<void(A0)> event(R(*func)(B0, B1, A0), C0 c0, C1 c1);
1820 
1821  /** Creates an event bound to the event queue
1822  * @see EventQueue::event
1823  */
1824  template <typename T, typename R, typename B0, typename B1, typename C0, typename C1, typename A0>
1825  Event<void(A0)> event(T *obj, R(T::*method)(B0, B1, A0), C0 c0, C1 c1);
1826 
1827  /** Creates an event bound to the event queue
1828  * @see EventQueue::event
1829  */
1830  template <typename T, typename R, typename B0, typename B1, typename C0, typename C1, typename A0>
1831  Event<void(A0)> event(const T *obj, R(T::*method)(B0, B1, A0) const, C0 c0, C1 c1);
1832 
1833  /** Creates an event bound to the event queue
1834  * @see EventQueue::event
1835  */
1836  template <typename T, typename R, typename B0, typename B1, typename C0, typename C1, typename A0>
1837  Event<void(A0)> event(volatile T *obj, R(T::*method)(B0, B1, A0) volatile, C0 c0, C1 c1);
1838 
1839  /** Creates an event bound to the event queue
1840  * @see EventQueue::event
1841  */
1842  template <typename T, typename R, typename B0, typename B1, typename C0, typename C1, typename A0>
1843  Event<void(A0)> event(const volatile T *obj, R(T::*method)(B0, B1, A0) const volatile, C0 c0, C1 c1);
1844 
1845  /** Creates an event bound to the event queue
1846  * @see EventQueue::event
1847  */
1848  template <typename R, typename B0, typename B1, typename C0, typename C1, typename A0>
1849  Event<void(A0)> event(mbed::Callback<R(B0, B1, A0)> cb, C0 c0, C1 c1);
1850 
1851  /** Creates an event bound to the event queue
1852  * @see EventQueue::event
1853  */
1854  template <typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0>
1855  Event<void(A0)> event(R(*func)(B0, B1, B2, A0), C0 c0, C1 c1, C2 c2);
1856 
1857  /** Creates an event bound to the event queue
1858  * @see EventQueue::event
1859  */
1860  template <typename T, typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0>
1861  Event<void(A0)> event(T *obj, R(T::*method)(B0, B1, B2, A0), C0 c0, C1 c1, C2 c2);
1862 
1863  /** Creates an event bound to the event queue
1864  * @see EventQueue::event
1865  */
1866  template <typename T, typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0>
1867  Event<void(A0)> event(const T *obj, R(T::*method)(B0, B1, B2, A0) const, C0 c0, C1 c1, C2 c2);
1868 
1869  /** Creates an event bound to the event queue
1870  * @see EventQueue::event
1871  */
1872  template <typename T, typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0>
1873  Event<void(A0)> event(volatile T *obj, R(T::*method)(B0, B1, B2, A0) volatile, C0 c0, C1 c1, C2 c2);
1874 
1875  /** Creates an event bound to the event queue
1876  * @see EventQueue::event
1877  */
1878  template <typename T, typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0>
1879  Event<void(A0)> event(const volatile T *obj, R(T::*method)(B0, B1, B2, A0) const volatile, C0 c0, C1 c1, C2 c2);
1880 
1881  /** Creates an event bound to the event queue
1882  * @see EventQueue::event
1883  */
1884  template <typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0>
1885  Event<void(A0)> event(mbed::Callback<R(B0, B1, B2, A0)> cb, C0 c0, C1 c1, C2 c2);
1886 
1887  /** Creates an event bound to the event queue
1888  * @see EventQueue::event
1889  */
1890  template <typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0>
1891  Event<void(A0)> event(R(*func)(B0, B1, B2, B3, A0), C0 c0, C1 c1, C2 c2, C3 c3);
1892 
1893  /** Creates an event bound to the event queue
1894  * @see EventQueue::event
1895  */
1896  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0>
1897  Event<void(A0)> event(T *obj, R(T::*method)(B0, B1, B2, B3, A0), C0 c0, C1 c1, C2 c2, C3 c3);
1898 
1899  /** Creates an event bound to the event queue
1900  * @see EventQueue::event
1901  */
1902  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0>
1903  Event<void(A0)> event(const T *obj, R(T::*method)(B0, B1, B2, B3, A0) const, C0 c0, C1 c1, C2 c2, C3 c3);
1904 
1905  /** Creates an event bound to the event queue
1906  * @see EventQueue::event
1907  */
1908  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0>
1909  Event<void(A0)> event(volatile T *obj, R(T::*method)(B0, B1, B2, B3, A0) volatile, C0 c0, C1 c1, C2 c2, C3 c3);
1910 
1911  /** Creates an event bound to the event queue
1912  * @see EventQueue::event
1913  */
1914  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0>
1915  Event<void(A0)> event(const volatile T *obj, R(T::*method)(B0, B1, B2, B3, A0) const volatile, C0 c0, C1 c1, C2 c2, C3 c3);
1916 
1917  /** Creates an event bound to the event queue
1918  * @see EventQueue::event
1919  */
1920  template <typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0>
1921  Event<void(A0)> event(mbed::Callback<R(B0, B1, B2, B3, A0)> cb, C0 c0, C1 c1, C2 c2, C3 c3);
1922 
1923  /** Creates an event bound to the event queue
1924  * @see EventQueue::event
1925  */
1926  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>
1927  Event<void(A0)> event(R(*func)(B0, B1, B2, B3, B4, A0), C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
1928 
1929  /** Creates an event bound to the event queue
1930  * @see EventQueue::event
1931  */
1932  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename B4, typename C0, typename C1, typename C2, typename C3, typename C4, typename A0>
1933  Event<void(A0)> event(T *obj, R(T::*method)(B0, B1, B2, B3, B4, A0), C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
1934 
1935  /** Creates an event bound to the event queue
1936  * @see EventQueue::event
1937  */
1938  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename B4, typename C0, typename C1, typename C2, typename C3, typename C4, typename A0>
1939  Event<void(A0)> event(const T *obj, R(T::*method)(B0, B1, B2, B3, B4, A0) const, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
1940 
1941  /** Creates an event bound to the event queue
1942  * @see EventQueue::event
1943  */
1944  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename B4, typename C0, typename C1, typename C2, typename C3, typename C4, typename A0>
1945  Event<void(A0)> event(volatile T *obj, R(T::*method)(B0, B1, B2, B3, B4, A0) volatile, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
1946 
1947  /** Creates an event bound to the event queue
1948  * @see EventQueue::event
1949  */
1950  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename B4, typename C0, typename C1, typename C2, typename C3, typename C4, typename A0>
1951  Event<void(A0)> event(const volatile T *obj, R(T::*method)(B0, B1, B2, B3, B4, A0) const volatile, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
1952 
1953  /** Creates an event bound to the event queue
1954  * @see EventQueue::event
1955  */
1956  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>
1957  Event<void(A0)> event(mbed::Callback<R(B0, B1, B2, B3, B4, A0)> cb, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
1958 
1959  /** Creates an event bound to the event queue
1960  * @see EventQueue::event
1961  */
1962  template <typename R, typename A0, typename A1>
1963  Event<void(A0, A1)> event(R(*func)(A0, A1));
1964 
1965  /** Creates an event bound to the event queue
1966  * @see EventQueue::event
1967  */
1968  template <typename T, typename R, typename A0, typename A1>
1969  Event<void(A0, A1)> event(T *obj, R(T::*method)(A0, A1));
1970 
1971  /** Creates an event bound to the event queue
1972  * @see EventQueue::event
1973  */
1974  template <typename T, typename R, typename A0, typename A1>
1975  Event<void(A0, A1)> event(const T *obj, R(T::*method)(A0, A1) const);
1976 
1977  /** Creates an event bound to the event queue
1978  * @see EventQueue::event
1979  */
1980  template <typename T, typename R, typename A0, typename A1>
1981  Event<void(A0, A1)> event(volatile T *obj, R(T::*method)(A0, A1) volatile);
1982 
1983  /** Creates an event bound to the event queue
1984  * @see EventQueue::event
1985  */
1986  template <typename T, typename R, typename A0, typename A1>
1987  Event<void(A0, A1)> event(const volatile T *obj, R(T::*method)(A0, A1) const volatile);
1988 
1989  /** Creates an event bound to the event queue
1990  * @see EventQueue::event
1991  */
1992  template <typename R, typename A0, typename A1>
1993  Event<void(A0, A1)> event(mbed::Callback<R(A0, A1)> cb);
1994 
1995  /** Creates an event bound to the event queue
1996  * @see EventQueue::event
1997  */
1998  template <typename R, typename B0, typename C0, typename A0, typename A1>
1999  Event<void(A0, A1)> event(R(*func)(B0, A0, A1), C0 c0);
2000 
2001  /** Creates an event bound to the event queue
2002  * @see EventQueue::event
2003  */
2004  template <typename T, typename R, typename B0, typename C0, typename A0, typename A1>
2005  Event<void(A0, A1)> event(T *obj, R(T::*method)(B0, A0, A1), C0 c0);
2006 
2007  /** Creates an event bound to the event queue
2008  * @see EventQueue::event
2009  */
2010  template <typename T, typename R, typename B0, typename C0, typename A0, typename A1>
2011  Event<void(A0, A1)> event(const T *obj, R(T::*method)(B0, A0, A1) const, C0 c0);
2012 
2013  /** Creates an event bound to the event queue
2014  * @see EventQueue::event
2015  */
2016  template <typename T, typename R, typename B0, typename C0, typename A0, typename A1>
2017  Event<void(A0, A1)> event(volatile T *obj, R(T::*method)(B0, A0, A1) volatile, C0 c0);
2018 
2019  /** Creates an event bound to the event queue
2020  * @see EventQueue::event
2021  */
2022  template <typename T, typename R, typename B0, typename C0, typename A0, typename A1>
2023  Event<void(A0, A1)> event(const volatile T *obj, R(T::*method)(B0, A0, A1) const volatile, C0 c0);
2024 
2025  /** Creates an event bound to the event queue
2026  * @see EventQueue::event
2027  */
2028  template <typename R, typename B0, typename C0, typename A0, typename A1>
2029  Event<void(A0, A1)> event(mbed::Callback<R(B0, A0, A1)> cb, C0 c0);
2030 
2031  /** Creates an event bound to the event queue
2032  * @see EventQueue::event
2033  */
2034  template <typename R, typename B0, typename B1, typename C0, typename C1, typename A0, typename A1>
2035  Event<void(A0, A1)> event(R(*func)(B0, B1, A0, A1), C0 c0, C1 c1);
2036 
2037  /** Creates an event bound to the event queue
2038  * @see EventQueue::event
2039  */
2040  template <typename T, typename R, typename B0, typename B1, typename C0, typename C1, typename A0, typename A1>
2041  Event<void(A0, A1)> event(T *obj, R(T::*method)(B0, B1, A0, A1), C0 c0, C1 c1);
2042 
2043  /** Creates an event bound to the event queue
2044  * @see EventQueue::event
2045  */
2046  template <typename T, typename R, typename B0, typename B1, typename C0, typename C1, typename A0, typename A1>
2047  Event<void(A0, A1)> event(const T *obj, R(T::*method)(B0, B1, A0, A1) const, C0 c0, C1 c1);
2048 
2049  /** Creates an event bound to the event queue
2050  * @see EventQueue::event
2051  */
2052  template <typename T, typename R, typename B0, typename B1, typename C0, typename C1, typename A0, typename A1>
2053  Event<void(A0, A1)> event(volatile T *obj, R(T::*method)(B0, B1, A0, A1) volatile, C0 c0, C1 c1);
2054 
2055  /** Creates an event bound to the event queue
2056  * @see EventQueue::event
2057  */
2058  template <typename T, typename R, typename B0, typename B1, typename C0, typename C1, typename A0, typename A1>
2059  Event<void(A0, A1)> event(const volatile T *obj, R(T::*method)(B0, B1, A0, A1) const volatile, C0 c0, C1 c1);
2060 
2061  /** Creates an event bound to the event queue
2062  * @see EventQueue::event
2063  */
2064  template <typename R, typename B0, typename B1, typename C0, typename C1, typename A0, typename A1>
2065  Event<void(A0, A1)> event(mbed::Callback<R(B0, B1, A0, A1)> cb, C0 c0, C1 c1);
2066 
2067  /** Creates an event bound to the event queue
2068  * @see EventQueue::event
2069  */
2070  template <typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0, typename A1>
2071  Event<void(A0, A1)> event(R(*func)(B0, B1, B2, A0, A1), C0 c0, C1 c1, C2 c2);
2072 
2073  /** Creates an event bound to the event queue
2074  * @see EventQueue::event
2075  */
2076  template <typename T, typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0, typename A1>
2077  Event<void(A0, A1)> event(T *obj, R(T::*method)(B0, B1, B2, A0, A1), C0 c0, C1 c1, C2 c2);
2078 
2079  /** Creates an event bound to the event queue
2080  * @see EventQueue::event
2081  */
2082  template <typename T, typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0, typename A1>
2083  Event<void(A0, A1)> event(const T *obj, R(T::*method)(B0, B1, B2, A0, A1) const, C0 c0, C1 c1, C2 c2);
2084 
2085  /** Creates an event bound to the event queue
2086  * @see EventQueue::event
2087  */
2088  template <typename T, typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0, typename A1>
2089  Event<void(A0, A1)> event(volatile T *obj, R(T::*method)(B0, B1, B2, A0, A1) volatile, C0 c0, C1 c1, C2 c2);
2090 
2091  /** Creates an event bound to the event queue
2092  * @see EventQueue::event
2093  */
2094  template <typename T, typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0, typename A1>
2095  Event<void(A0, A1)> event(const volatile T *obj, R(T::*method)(B0, B1, B2, A0, A1) const volatile, C0 c0, C1 c1, C2 c2);
2096 
2097  /** Creates an event bound to the event queue
2098  * @see EventQueue::event
2099  */
2100  template <typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0, typename A1>
2101  Event<void(A0, A1)> event(mbed::Callback<R(B0, B1, B2, A0, A1)> cb, C0 c0, C1 c1, C2 c2);
2102 
2103  /** Creates an event bound to the event queue
2104  * @see EventQueue::event
2105  */
2106  template <typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1>
2107  Event<void(A0, A1)> event(R(*func)(B0, B1, B2, B3, A0, A1), C0 c0, C1 c1, C2 c2, C3 c3);
2108 
2109  /** Creates an event bound to the event queue
2110  * @see EventQueue::event
2111  */
2112  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1>
2113  Event<void(A0, A1)> event(T *obj, R(T::*method)(B0, B1, B2, B3, A0, A1), C0 c0, C1 c1, C2 c2, C3 c3);
2114 
2115  /** Creates an event bound to the event queue
2116  * @see EventQueue::event
2117  */
2118  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1>
2119  Event<void(A0, A1)> event(const T *obj, R(T::*method)(B0, B1, B2, B3, A0, A1) const, C0 c0, C1 c1, C2 c2, C3 c3);
2120 
2121  /** Creates an event bound to the event queue
2122  * @see EventQueue::event
2123  */
2124  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1>
2125  Event<void(A0, A1)> event(volatile T *obj, R(T::*method)(B0, B1, B2, B3, A0, A1) volatile, C0 c0, C1 c1, C2 c2, C3 c3);
2126 
2127  /** Creates an event bound to the event queue
2128  * @see EventQueue::event
2129  */
2130  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1>
2131  Event<void(A0, A1)> event(const volatile T *obj, R(T::*method)(B0, B1, B2, B3, A0, A1) const volatile, C0 c0, C1 c1, C2 c2, C3 c3);
2132 
2133  /** Creates an event bound to the event queue
2134  * @see EventQueue::event
2135  */
2136  template <typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1>
2137  Event<void(A0, A1)> event(mbed::Callback<R(B0, B1, B2, B3, A0, A1)> cb, C0 c0, C1 c1, C2 c2, C3 c3);
2138 
2139  /** Creates an event bound to the event queue
2140  * @see EventQueue::event
2141  */
2142  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>
2143  Event<void(A0, A1)> event(R(*func)(B0, B1, B2, B3, B4, A0, A1), C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
2144 
2145  /** Creates an event bound to the event queue
2146  * @see EventQueue::event
2147  */
2148  template <typename T, 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>
2149  Event<void(A0, A1)> event(T *obj, R(T::*method)(B0, B1, B2, B3, B4, A0, A1), C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
2150 
2151  /** Creates an event bound to the event queue
2152  * @see EventQueue::event
2153  */
2154  template <typename T, 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>
2155  Event<void(A0, A1)> event(const T *obj, R(T::*method)(B0, B1, B2, B3, B4, A0, A1) const, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
2156 
2157  /** Creates an event bound to the event queue
2158  * @see EventQueue::event
2159  */
2160  template <typename T, 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>
2161  Event<void(A0, A1)> event(volatile T *obj, R(T::*method)(B0, B1, B2, B3, B4, A0, A1) volatile, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
2162 
2163  /** Creates an event bound to the event queue
2164  * @see EventQueue::event
2165  */
2166  template <typename T, 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>
2167  Event<void(A0, A1)> event(const volatile T *obj, R(T::*method)(B0, B1, B2, B3, B4, A0, A1) const volatile, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
2168 
2169  /** Creates an event bound to the event queue
2170  * @see EventQueue::event
2171  */
2172  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>
2173  Event<void(A0, A1)> event(mbed::Callback<R(B0, B1, B2, B3, B4, A0, A1)> cb, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
2174 
2175  /** Creates an event bound to the event queue
2176  * @see EventQueue::event
2177  */
2178  template <typename R, typename A0, typename A1, typename A2>
2179  Event<void(A0, A1, A2)> event(R(*func)(A0, A1, A2));
2180 
2181  /** Creates an event bound to the event queue
2182  * @see EventQueue::event
2183  */
2184  template <typename T, typename R, typename A0, typename A1, typename A2>
2185  Event<void(A0, A1, A2)> event(T *obj, R(T::*method)(A0, A1, A2));
2186 
2187  /** Creates an event bound to the event queue
2188  * @see EventQueue::event
2189  */
2190  template <typename T, typename R, typename A0, typename A1, typename A2>
2191  Event<void(A0, A1, A2)> event(const T *obj, R(T::*method)(A0, A1, A2) const);
2192 
2193  /** Creates an event bound to the event queue
2194  * @see EventQueue::event
2195  */
2196  template <typename T, typename R, typename A0, typename A1, typename A2>
2197  Event<void(A0, A1, A2)> event(volatile T *obj, R(T::*method)(A0, A1, A2) volatile);
2198 
2199  /** Creates an event bound to the event queue
2200  * @see EventQueue::event
2201  */
2202  template <typename T, typename R, typename A0, typename A1, typename A2>
2203  Event<void(A0, A1, A2)> event(const volatile T *obj, R(T::*method)(A0, A1, A2) const volatile);
2204 
2205  /** Creates an event bound to the event queue
2206  * @see EventQueue::event
2207  */
2208  template <typename R, typename A0, typename A1, typename A2>
2209  Event<void(A0, A1, A2)> event(mbed::Callback<R(A0, A1, A2)> cb);
2210 
2211  /** Creates an event bound to the event queue
2212  * @see EventQueue::event
2213  */
2214  template <typename R, typename B0, typename C0, typename A0, typename A1, typename A2>
2215  Event<void(A0, A1, A2)> event(R(*func)(B0, A0, A1, A2), C0 c0);
2216 
2217  /** Creates an event bound to the event queue
2218  * @see EventQueue::event
2219  */
2220  template <typename T, typename R, typename B0, typename C0, typename A0, typename A1, typename A2>
2221  Event<void(A0, A1, A2)> event(T *obj, R(T::*method)(B0, A0, A1, A2), C0 c0);
2222 
2223  /** Creates an event bound to the event queue
2224  * @see EventQueue::event
2225  */
2226  template <typename T, typename R, typename B0, typename C0, typename A0, typename A1, typename A2>
2227  Event<void(A0, A1, A2)> event(const T *obj, R(T::*method)(B0, A0, A1, A2) const, C0 c0);
2228 
2229  /** Creates an event bound to the event queue
2230  * @see EventQueue::event
2231  */
2232  template <typename T, typename R, typename B0, typename C0, typename A0, typename A1, typename A2>
2233  Event<void(A0, A1, A2)> event(volatile T *obj, R(T::*method)(B0, A0, A1, A2) volatile, C0 c0);
2234 
2235  /** Creates an event bound to the event queue
2236  * @see EventQueue::event
2237  */
2238  template <typename T, typename R, typename B0, typename C0, typename A0, typename A1, typename A2>
2239  Event<void(A0, A1, A2)> event(const volatile T *obj, R(T::*method)(B0, A0, A1, A2) const volatile, C0 c0);
2240 
2241  /** Creates an event bound to the event queue
2242  * @see EventQueue::event
2243  */
2244  template <typename R, typename B0, typename C0, typename A0, typename A1, typename A2>
2245  Event<void(A0, A1, A2)> event(mbed::Callback<R(B0, A0, A1, A2)> cb, C0 c0);
2246 
2247  /** Creates an event bound to the event queue
2248  * @see EventQueue::event
2249  */
2250  template <typename R, typename B0, typename B1, typename C0, typename C1, typename A0, typename A1, typename A2>
2251  Event<void(A0, A1, A2)> event(R(*func)(B0, B1, A0, A1, A2), C0 c0, C1 c1);
2252 
2253  /** Creates an event bound to the event queue
2254  * @see EventQueue::event
2255  */
2256  template <typename T, typename R, typename B0, typename B1, typename C0, typename C1, typename A0, typename A1, typename A2>
2257  Event<void(A0, A1, A2)> event(T *obj, R(T::*method)(B0, B1, A0, A1, A2), C0 c0, C1 c1);
2258 
2259  /** Creates an event bound to the event queue
2260  * @see EventQueue::event
2261  */
2262  template <typename T, typename R, typename B0, typename B1, typename C0, typename C1, typename A0, typename A1, typename A2>
2263  Event<void(A0, A1, A2)> event(const T *obj, R(T::*method)(B0, B1, A0, A1, A2) const, C0 c0, C1 c1);
2264 
2265  /** Creates an event bound to the event queue
2266  * @see EventQueue::event
2267  */
2268  template <typename T, typename R, typename B0, typename B1, typename C0, typename C1, typename A0, typename A1, typename A2>
2269  Event<void(A0, A1, A2)> event(volatile T *obj, R(T::*method)(B0, B1, A0, A1, A2) volatile, C0 c0, C1 c1);
2270 
2271  /** Creates an event bound to the event queue
2272  * @see EventQueue::event
2273  */
2274  template <typename T, typename R, typename B0, typename B1, typename C0, typename C1, typename A0, typename A1, typename A2>
2275  Event<void(A0, A1, A2)> event(const volatile T *obj, R(T::*method)(B0, B1, A0, A1, A2) const volatile, C0 c0, C1 c1);
2276 
2277  /** Creates an event bound to the event queue
2278  * @see EventQueue::event
2279  */
2280  template <typename R, typename B0, typename B1, typename C0, typename C1, typename A0, typename A1, typename A2>
2281  Event<void(A0, A1, A2)> event(mbed::Callback<R(B0, B1, A0, A1, A2)> cb, C0 c0, C1 c1);
2282 
2283  /** Creates an event bound to the event queue
2284  * @see EventQueue::event
2285  */
2286  template <typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0, typename A1, typename A2>
2287  Event<void(A0, A1, A2)> event(R(*func)(B0, B1, B2, A0, A1, A2), C0 c0, C1 c1, C2 c2);
2288 
2289  /** Creates an event bound to the event queue
2290  * @see EventQueue::event
2291  */
2292  template <typename T, typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0, typename A1, typename A2>
2293  Event<void(A0, A1, A2)> event(T *obj, R(T::*method)(B0, B1, B2, A0, A1, A2), C0 c0, C1 c1, C2 c2);
2294 
2295  /** Creates an event bound to the event queue
2296  * @see EventQueue::event
2297  */
2298  template <typename T, typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0, typename A1, typename A2>
2299  Event<void(A0, A1, A2)> event(const T *obj, R(T::*method)(B0, B1, B2, A0, A1, A2) const, C0 c0, C1 c1, C2 c2);
2300 
2301  /** Creates an event bound to the event queue
2302  * @see EventQueue::event
2303  */
2304  template <typename T, typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0, typename A1, typename A2>
2305  Event<void(A0, A1, A2)> event(volatile T *obj, R(T::*method)(B0, B1, B2, A0, A1, A2) volatile, C0 c0, C1 c1, C2 c2);
2306 
2307  /** Creates an event bound to the event queue
2308  * @see EventQueue::event
2309  */
2310  template <typename T, typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0, typename A1, typename A2>
2311  Event<void(A0, A1, A2)> event(const volatile T *obj, R(T::*method)(B0, B1, B2, A0, A1, A2) const volatile, C0 c0, C1 c1, C2 c2);
2312 
2313  /** Creates an event bound to the event queue
2314  * @see EventQueue::event
2315  */
2316  template <typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0, typename A1, typename A2>
2317  Event<void(A0, A1, A2)> event(mbed::Callback<R(B0, B1, B2, A0, A1, A2)> cb, C0 c0, C1 c1, C2 c2);
2318 
2319  /** Creates an event bound to the event queue
2320  * @see EventQueue::event
2321  */
2322  template <typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1, typename A2>
2323  Event<void(A0, A1, A2)> event(R(*func)(B0, B1, B2, B3, A0, A1, A2), C0 c0, C1 c1, C2 c2, C3 c3);
2324 
2325  /** Creates an event bound to the event queue
2326  * @see EventQueue::event
2327  */
2328  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1, typename A2>
2329  Event<void(A0, A1, A2)> event(T *obj, R(T::*method)(B0, B1, B2, B3, A0, A1, A2), C0 c0, C1 c1, C2 c2, C3 c3);
2330 
2331  /** Creates an event bound to the event queue
2332  * @see EventQueue::event
2333  */
2334  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1, typename A2>
2335  Event<void(A0, A1, A2)> event(const T *obj, R(T::*method)(B0, B1, B2, B3, A0, A1, A2) const, C0 c0, C1 c1, C2 c2, C3 c3);
2336 
2337  /** Creates an event bound to the event queue
2338  * @see EventQueue::event
2339  */
2340  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1, typename A2>
2341  Event<void(A0, A1, A2)> event(volatile T *obj, R(T::*method)(B0, B1, B2, B3, A0, A1, A2) volatile, C0 c0, C1 c1, C2 c2, C3 c3);
2342 
2343  /** Creates an event bound to the event queue
2344  * @see EventQueue::event
2345  */
2346  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1, typename A2>
2347  Event<void(A0, A1, A2)> event(const volatile T *obj, R(T::*method)(B0, B1, B2, B3, A0, A1, A2) const volatile, C0 c0, C1 c1, C2 c2, C3 c3);
2348 
2349  /** Creates an event bound to the event queue
2350  * @see EventQueue::event
2351  */
2352  template <typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1, typename A2>
2353  Event<void(A0, A1, A2)> event(mbed::Callback<R(B0, B1, B2, B3, A0, A1, A2)> cb, C0 c0, C1 c1, C2 c2, C3 c3);
2354 
2355  /** Creates an event bound to the event queue
2356  * @see EventQueue::event
2357  */
2358  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>
2359  Event<void(A0, A1, A2)> event(R(*func)(B0, B1, B2, B3, B4, A0, A1, A2), C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
2360 
2361  /** Creates an event bound to the event queue
2362  * @see EventQueue::event
2363  */
2364  template <typename T, 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>
2365  Event<void(A0, A1, A2)> event(T *obj, R(T::*method)(B0, B1, B2, B3, B4, A0, A1, A2), C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
2366 
2367  /** Creates an event bound to the event queue
2368  * @see EventQueue::event
2369  */
2370  template <typename T, 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>
2371  Event<void(A0, A1, A2)> event(const T *obj, R(T::*method)(B0, B1, B2, B3, B4, A0, A1, A2) const, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
2372 
2373  /** Creates an event bound to the event queue
2374  * @see EventQueue::event
2375  */
2376  template <typename T, 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>
2377  Event<void(A0, A1, A2)> event(volatile T *obj, R(T::*method)(B0, B1, B2, B3, B4, A0, A1, A2) volatile, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
2378 
2379  /** Creates an event bound to the event queue
2380  * @see EventQueue::event
2381  */
2382  template <typename T, 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>
2383  Event<void(A0, A1, A2)> event(const volatile T *obj, R(T::*method)(B0, B1, B2, B3, B4, A0, A1, A2) const volatile, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
2384 
2385  /** Creates an event bound to the event queue
2386  * @see EventQueue::event
2387  */
2388  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>
2389  Event<void(A0, A1, A2)> event(mbed::Callback<R(B0, B1, B2, B3, B4, A0, A1, A2)> cb, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
2390 
2391  /** Creates an event bound to the event queue
2392  * @see EventQueue::event
2393  */
2394  template <typename R, typename A0, typename A1, typename A2, typename A3>
2395  Event<void(A0, A1, A2, A3)> event(R(*func)(A0, A1, A2, A3));
2396 
2397  /** Creates an event bound to the event queue
2398  * @see EventQueue::event
2399  */
2400  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3>
2401  Event<void(A0, A1, A2, A3)> event(T *obj, R(T::*method)(A0, A1, A2, A3));
2402 
2403  /** Creates an event bound to the event queue
2404  * @see EventQueue::event
2405  */
2406  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3>
2407  Event<void(A0, A1, A2, A3)> event(const T *obj, R(T::*method)(A0, A1, A2, A3) const);
2408 
2409  /** Creates an event bound to the event queue
2410  * @see EventQueue::event
2411  */
2412  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3>
2413  Event<void(A0, A1, A2, A3)> event(volatile T *obj, R(T::*method)(A0, A1, A2, A3) volatile);
2414 
2415  /** Creates an event bound to the event queue
2416  * @see EventQueue::event
2417  */
2418  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3>
2419  Event<void(A0, A1, A2, A3)> event(const volatile T *obj, R(T::*method)(A0, A1, A2, A3) const volatile);
2420 
2421  /** Creates an event bound to the event queue
2422  * @see EventQueue::event
2423  */
2424  template <typename R, typename A0, typename A1, typename A2, typename A3>
2425  Event<void(A0, A1, A2, A3)> event(mbed::Callback<R(A0, A1, A2, A3)> cb);
2426 
2427  /** Creates an event bound to the event queue
2428  * @see EventQueue::event
2429  */
2430  template <typename R, typename B0, typename C0, typename A0, typename A1, typename A2, typename A3>
2431  Event<void(A0, A1, A2, A3)> event(R(*func)(B0, A0, A1, A2, A3), C0 c0);
2432 
2433  /** Creates an event bound to the event queue
2434  * @see EventQueue::event
2435  */
2436  template <typename T, typename R, typename B0, typename C0, typename A0, typename A1, typename A2, typename A3>
2437  Event<void(A0, A1, A2, A3)> event(T *obj, R(T::*method)(B0, A0, A1, A2, A3), C0 c0);
2438 
2439  /** Creates an event bound to the event queue
2440  * @see EventQueue::event
2441  */
2442  template <typename T, typename R, typename B0, typename C0, typename A0, typename A1, typename A2, typename A3>
2443  Event<void(A0, A1, A2, A3)> event(const T *obj, R(T::*method)(B0, A0, A1, A2, A3) const, C0 c0);
2444 
2445  /** Creates an event bound to the event queue
2446  * @see EventQueue::event
2447  */
2448  template <typename T, typename R, typename B0, typename C0, typename A0, typename A1, typename A2, typename A3>
2449  Event<void(A0, A1, A2, A3)> event(volatile T *obj, R(T::*method)(B0, A0, A1, A2, A3) volatile, C0 c0);
2450 
2451  /** Creates an event bound to the event queue
2452  * @see EventQueue::event
2453  */
2454  template <typename T, typename R, typename B0, typename C0, typename A0, typename A1, typename A2, typename A3>
2455  Event<void(A0, A1, A2, A3)> event(const volatile T *obj, R(T::*method)(B0, A0, A1, A2, A3) const volatile, C0 c0);
2456 
2457  /** Creates an event bound to the event queue
2458  * @see EventQueue::event
2459  */
2460  template <typename R, typename B0, typename C0, typename A0, typename A1, typename A2, typename A3>
2461  Event<void(A0, A1, A2, A3)> event(mbed::Callback<R(B0, A0, A1, A2, A3)> cb, C0 c0);
2462 
2463  /** Creates an event bound to the event queue
2464  * @see EventQueue::event
2465  */
2466  template <typename R, typename B0, typename B1, typename C0, typename C1, typename A0, typename A1, typename A2, typename A3>
2467  Event<void(A0, A1, A2, A3)> event(R(*func)(B0, B1, A0, A1, A2, A3), C0 c0, C1 c1);
2468 
2469  /** Creates an event bound to the event queue
2470  * @see EventQueue::event
2471  */
2472  template <typename T, typename R, typename B0, typename B1, typename C0, typename C1, typename A0, typename A1, typename A2, typename A3>
2473  Event<void(A0, A1, A2, A3)> event(T *obj, R(T::*method)(B0, B1, A0, A1, A2, A3), C0 c0, C1 c1);
2474 
2475  /** Creates an event bound to the event queue
2476  * @see EventQueue::event
2477  */
2478  template <typename T, typename R, typename B0, typename B1, typename C0, typename C1, typename A0, typename A1, typename A2, typename A3>
2479  Event<void(A0, A1, A2, A3)> event(const T *obj, R(T::*method)(B0, B1, A0, A1, A2, A3) const, C0 c0, C1 c1);
2480 
2481  /** Creates an event bound to the event queue
2482  * @see EventQueue::event
2483  */
2484  template <typename T, typename R, typename B0, typename B1, typename C0, typename C1, typename A0, typename A1, typename A2, typename A3>
2485  Event<void(A0, A1, A2, A3)> event(volatile T *obj, R(T::*method)(B0, B1, A0, A1, A2, A3) volatile, C0 c0, C1 c1);
2486 
2487  /** Creates an event bound to the event queue
2488  * @see EventQueue::event
2489  */
2490  template <typename T, typename R, typename B0, typename B1, typename C0, typename C1, typename A0, typename A1, typename A2, typename A3>
2491  Event<void(A0, A1, A2, A3)> event(const volatile T *obj, R(T::*method)(B0, B1, A0, A1, A2, A3) const volatile, C0 c0, C1 c1);
2492 
2493  /** Creates an event bound to the event queue
2494  * @see EventQueue::event
2495  */
2496  template <typename R, typename B0, typename B1, typename C0, typename C1, typename A0, typename A1, typename A2, typename A3>
2497  Event<void(A0, A1, A2, A3)> event(mbed::Callback<R(B0, B1, A0, A1, A2, A3)> cb, C0 c0, C1 c1);
2498 
2499  /** Creates an event bound to the event queue
2500  * @see EventQueue::event
2501  */
2502  template <typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0, typename A1, typename A2, typename A3>
2503  Event<void(A0, A1, A2, A3)> event(R(*func)(B0, B1, B2, A0, A1, A2, A3), C0 c0, C1 c1, C2 c2);
2504 
2505  /** Creates an event bound to the event queue
2506  * @see EventQueue::event
2507  */
2508  template <typename T, typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0, typename A1, typename A2, typename A3>
2509  Event<void(A0, A1, A2, A3)> event(T *obj, R(T::*method)(B0, B1, B2, A0, A1, A2, A3), C0 c0, C1 c1, C2 c2);
2510 
2511  /** Creates an event bound to the event queue
2512  * @see EventQueue::event
2513  */
2514  template <typename T, typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0, typename A1, typename A2, typename A3>
2515  Event<void(A0, A1, A2, A3)> event(const T *obj, R(T::*method)(B0, B1, B2, A0, A1, A2, A3) const, C0 c0, C1 c1, C2 c2);
2516 
2517  /** Creates an event bound to the event queue
2518  * @see EventQueue::event
2519  */
2520  template <typename T, typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0, typename A1, typename A2, typename A3>
2521  Event<void(A0, A1, A2, A3)> event(volatile T *obj, R(T::*method)(B0, B1, B2, A0, A1, A2, A3) volatile, C0 c0, C1 c1, C2 c2);
2522 
2523  /** Creates an event bound to the event queue
2524  * @see EventQueue::event
2525  */
2526  template <typename T, typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0, typename A1, typename A2, typename A3>
2527  Event<void(A0, A1, A2, A3)> event(const volatile T *obj, R(T::*method)(B0, B1, B2, A0, A1, A2, A3) const volatile, C0 c0, C1 c1, C2 c2);
2528 
2529  /** Creates an event bound to the event queue
2530  * @see EventQueue::event
2531  */
2532  template <typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0, typename A1, typename A2, typename A3>
2533  Event<void(A0, A1, A2, A3)> event(mbed::Callback<R(B0, B1, B2, A0, A1, A2, A3)> cb, C0 c0, C1 c1, C2 c2);
2534 
2535  /** Creates an event bound to the event queue
2536  * @see EventQueue::event
2537  */
2538  template <typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1, typename A2, typename A3>
2539  Event<void(A0, A1, A2, A3)> event(R(*func)(B0, B1, B2, B3, A0, A1, A2, A3), C0 c0, C1 c1, C2 c2, C3 c3);
2540 
2541  /** Creates an event bound to the event queue
2542  * @see EventQueue::event
2543  */
2544  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1, typename A2, typename A3>
2545  Event<void(A0, A1, A2, A3)> event(T *obj, R(T::*method)(B0, B1, B2, B3, A0, A1, A2, A3), C0 c0, C1 c1, C2 c2, C3 c3);
2546 
2547  /** Creates an event bound to the event queue
2548  * @see EventQueue::event
2549  */
2550  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1, typename A2, typename A3>
2551  Event<void(A0, A1, A2, A3)> event(const T *obj, R(T::*method)(B0, B1, B2, B3, A0, A1, A2, A3) const, C0 c0, C1 c1, C2 c2, C3 c3);
2552 
2553  /** Creates an event bound to the event queue
2554  * @see EventQueue::event
2555  */
2556  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1, typename A2, typename A3>
2557  Event<void(A0, A1, A2, A3)> event(volatile T *obj, R(T::*method)(B0, B1, B2, B3, A0, A1, A2, A3) volatile, C0 c0, C1 c1, C2 c2, C3 c3);
2558 
2559  /** Creates an event bound to the event queue
2560  * @see EventQueue::event
2561  */
2562  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1, typename A2, typename A3>
2563  Event<void(A0, A1, A2, A3)> event(const volatile T *obj, R(T::*method)(B0, B1, B2, B3, A0, A1, A2, A3) const volatile, C0 c0, C1 c1, C2 c2, C3 c3);
2564 
2565  /** Creates an event bound to the event queue
2566  * @see EventQueue::event
2567  */
2568  template <typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1, typename A2, typename A3>
2569  Event<void(A0, A1, A2, A3)> event(mbed::Callback<R(B0, B1, B2, B3, A0, A1, A2, A3)> cb, C0 c0, C1 c1, C2 c2, C3 c3);
2570 
2571  /** Creates an event bound to the event queue
2572  * @see EventQueue::event
2573  */
2574  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>
2575  Event<void(A0, A1, A2, A3)> event(R(*func)(B0, B1, B2, B3, B4, A0, A1, A2, A3), C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
2576 
2577  /** Creates an event bound to the event queue
2578  * @see EventQueue::event
2579  */
2580  template <typename T, 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>
2581  Event<void(A0, A1, A2, A3)> event(T *obj, R(T::*method)(B0, B1, B2, B3, B4, A0, A1, A2, A3), C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
2582 
2583  /** Creates an event bound to the event queue
2584  * @see EventQueue::event
2585  */
2586  template <typename T, 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>
2587  Event<void(A0, A1, A2, A3)> event(const T *obj, R(T::*method)(B0, B1, B2, B3, B4, A0, A1, A2, A3) const, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
2588 
2589  /** Creates an event bound to the event queue
2590  * @see EventQueue::event
2591  */
2592  template <typename T, 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>
2593  Event<void(A0, A1, A2, A3)> event(volatile T *obj, R(T::*method)(B0, B1, B2, B3, B4, A0, A1, A2, A3) volatile, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
2594 
2595  /** Creates an event bound to the event queue
2596  * @see EventQueue::event
2597  */
2598  template <typename T, 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>
2599  Event<void(A0, A1, A2, A3)> event(const volatile T *obj, R(T::*method)(B0, B1, B2, B3, B4, A0, A1, A2, A3) const volatile, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
2600 
2601  /** Creates an event bound to the event queue
2602  * @see EventQueue::event
2603  */
2604  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>
2605  Event<void(A0, A1, A2, A3)> event(mbed::Callback<R(B0, B1, B2, B3, B4, A0, A1, A2, A3)> cb, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
2606 
2607  /** Creates an event bound to the event queue
2608  * @see EventQueue::event
2609  */
2610  template <typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
2611  Event<void(A0, A1, A2, A3, A4)> event(R(*func)(A0, A1, A2, A3, A4));
2612 
2613  /** Creates an event bound to the event queue
2614  * @see EventQueue::event
2615  */
2616  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
2617  Event<void(A0, A1, A2, A3, A4)> event(T *obj, R(T::*method)(A0, A1, A2, A3, A4));
2618 
2619  /** Creates an event bound to the event queue
2620  * @see EventQueue::event
2621  */
2622  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
2623  Event<void(A0, A1, A2, A3, A4)> event(const T *obj, R(T::*method)(A0, A1, A2, A3, A4) const);
2624 
2625  /** Creates an event bound to the event queue
2626  * @see EventQueue::event
2627  */
2628  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
2629  Event<void(A0, A1, A2, A3, A4)> event(volatile T *obj, R(T::*method)(A0, A1, A2, A3, A4) volatile);
2630 
2631  /** Creates an event bound to the event queue
2632  * @see EventQueue::event
2633  */
2634  template <typename T, typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
2635  Event<void(A0, A1, A2, A3, A4)> event(const volatile T *obj, R(T::*method)(A0, A1, A2, A3, A4) const volatile);
2636 
2637  /** Creates an event bound to the event queue
2638  * @see EventQueue::event
2639  */
2640  template <typename R, typename A0, typename A1, typename A2, typename A3, typename A4>
2641  Event<void(A0, A1, A2, A3, A4)> event(mbed::Callback<R(A0, A1, A2, A3, A4)> cb);
2642 
2643  /** Creates an event bound to the event queue
2644  * @see EventQueue::event
2645  */
2646  template <typename R, typename B0, typename C0, typename A0, typename A1, typename A2, typename A3, typename A4>
2647  Event<void(A0, A1, A2, A3, A4)> event(R(*func)(B0, A0, A1, A2, A3, A4), C0 c0);
2648 
2649  /** Creates an event bound to the event queue
2650  * @see EventQueue::event
2651  */
2652  template <typename T, typename R, typename B0, typename C0, typename A0, typename A1, typename A2, typename A3, typename A4>
2653  Event<void(A0, A1, A2, A3, A4)> event(T *obj, R(T::*method)(B0, A0, A1, A2, A3, A4), C0 c0);
2654 
2655  /** Creates an event bound to the event queue
2656  * @see EventQueue::event
2657  */
2658  template <typename T, typename R, typename B0, typename C0, typename A0, typename A1, typename A2, typename A3, typename A4>
2659  Event<void(A0, A1, A2, A3, A4)> event(const T *obj, R(T::*method)(B0, A0, A1, A2, A3, A4) const, C0 c0);
2660 
2661  /** Creates an event bound to the event queue
2662  * @see EventQueue::event
2663  */
2664  template <typename T, typename R, typename B0, typename C0, typename A0, typename A1, typename A2, typename A3, typename A4>
2665  Event<void(A0, A1, A2, A3, A4)> event(volatile T *obj, R(T::*method)(B0, A0, A1, A2, A3, A4) volatile, C0 c0);
2666 
2667  /** Creates an event bound to the event queue
2668  * @see EventQueue::event
2669  */
2670  template <typename T, typename R, typename B0, typename C0, typename A0, typename A1, typename A2, typename A3, typename A4>
2671  Event<void(A0, A1, A2, A3, A4)> event(const volatile T *obj, R(T::*method)(B0, A0, A1, A2, A3, A4) const volatile, C0 c0);
2672 
2673  /** Creates an event bound to the event queue
2674  * @see EventQueue::event
2675  */
2676  template <typename R, typename B0, typename C0, typename A0, typename A1, typename A2, typename A3, typename A4>
2677  Event<void(A0, A1, A2, A3, A4)> event(mbed::Callback<R(B0, A0, A1, A2, A3, A4)> cb, C0 c0);
2678 
2679  /** Creates an event bound to the event queue
2680  * @see EventQueue::event
2681  */
2682  template <typename R, typename B0, typename B1, typename C0, typename C1, typename A0, typename A1, typename A2, typename A3, typename A4>
2683  Event<void(A0, A1, A2, A3, A4)> event(R(*func)(B0, B1, A0, A1, A2, A3, A4), C0 c0, C1 c1);
2684 
2685  /** Creates an event bound to the event queue
2686  * @see EventQueue::event
2687  */
2688  template <typename T, typename R, typename B0, typename B1, typename C0, typename C1, typename A0, typename A1, typename A2, typename A3, typename A4>
2689  Event<void(A0, A1, A2, A3, A4)> event(T *obj, R(T::*method)(B0, B1, A0, A1, A2, A3, A4), C0 c0, C1 c1);
2690 
2691  /** Creates an event bound to the event queue
2692  * @see EventQueue::event
2693  */
2694  template <typename T, typename R, typename B0, typename B1, typename C0, typename C1, typename A0, typename A1, typename A2, typename A3, typename A4>
2695  Event<void(A0, A1, A2, A3, A4)> event(const T *obj, R(T::*method)(B0, B1, A0, A1, A2, A3, A4) const, C0 c0, C1 c1);
2696 
2697  /** Creates an event bound to the event queue
2698  * @see EventQueue::event
2699  */
2700  template <typename T, typename R, typename B0, typename B1, typename C0, typename C1, typename A0, typename A1, typename A2, typename A3, typename A4>
2701  Event<void(A0, A1, A2, A3, A4)> event(volatile T *obj, R(T::*method)(B0, B1, A0, A1, A2, A3, A4) volatile, C0 c0, C1 c1);
2702 
2703  /** Creates an event bound to the event queue
2704  * @see EventQueue::event
2705  */
2706  template <typename T, typename R, typename B0, typename B1, typename C0, typename C1, typename A0, typename A1, typename A2, typename A3, typename A4>
2707  Event<void(A0, A1, A2, A3, A4)> event(const volatile T *obj, R(T::*method)(B0, B1, A0, A1, A2, A3, A4) const volatile, C0 c0, C1 c1);
2708 
2709  /** Creates an event bound to the event queue
2710  * @see EventQueue::event
2711  */
2712  template <typename R, typename B0, typename B1, typename C0, typename C1, typename A0, typename A1, typename A2, typename A3, typename A4>
2713  Event<void(A0, A1, A2, A3, A4)> event(mbed::Callback<R(B0, B1, A0, A1, A2, A3, A4)> cb, C0 c0, C1 c1);
2714 
2715  /** Creates an event bound to the event queue
2716  * @see EventQueue::event
2717  */
2718  template <typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0, typename A1, typename A2, typename A3, typename A4>
2719  Event<void(A0, A1, A2, A3, A4)> event(R(*func)(B0, B1, B2, A0, A1, A2, A3, A4), C0 c0, C1 c1, C2 c2);
2720 
2721  /** Creates an event bound to the event queue
2722  * @see EventQueue::event
2723  */
2724  template <typename T, typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0, typename A1, typename A2, typename A3, typename A4>
2725  Event<void(A0, A1, A2, A3, A4)> event(T *obj, R(T::*method)(B0, B1, B2, A0, A1, A2, A3, A4), C0 c0, C1 c1, C2 c2);
2726 
2727  /** Creates an event bound to the event queue
2728  * @see EventQueue::event
2729  */
2730  template <typename T, typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0, typename A1, typename A2, typename A3, typename A4>
2731  Event<void(A0, A1, A2, A3, A4)> event(const T *obj, R(T::*method)(B0, B1, B2, A0, A1, A2, A3, A4) const, C0 c0, C1 c1, C2 c2);
2732 
2733  /** Creates an event bound to the event queue
2734  * @see EventQueue::event
2735  */
2736  template <typename T, typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0, typename A1, typename A2, typename A3, typename A4>
2737  Event<void(A0, A1, A2, A3, A4)> event(volatile T *obj, R(T::*method)(B0, B1, B2, A0, A1, A2, A3, A4) volatile, C0 c0, C1 c1, C2 c2);
2738 
2739  /** Creates an event bound to the event queue
2740  * @see EventQueue::event
2741  */
2742  template <typename T, typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0, typename A1, typename A2, typename A3, typename A4>
2743  Event<void(A0, A1, A2, A3, A4)> event(const volatile T *obj, R(T::*method)(B0, B1, B2, A0, A1, A2, A3, A4) const volatile, C0 c0, C1 c1, C2 c2);
2744 
2745  /** Creates an event bound to the event queue
2746  * @see EventQueue::event
2747  */
2748  template <typename R, typename B0, typename B1, typename B2, typename C0, typename C1, typename C2, typename A0, typename A1, typename A2, typename A3, typename A4>
2749  Event<void(A0, A1, A2, A3, A4)> event(mbed::Callback<R(B0, B1, B2, A0, A1, A2, A3, A4)> cb, C0 c0, C1 c1, C2 c2);
2750 
2751  /** Creates an event bound to the event queue
2752  * @see EventQueue::event
2753  */
2754  template <typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1, typename A2, typename A3, typename A4>
2755  Event<void(A0, A1, A2, A3, A4)> event(R(*func)(B0, B1, B2, B3, A0, A1, A2, A3, A4), C0 c0, C1 c1, C2 c2, C3 c3);
2756 
2757  /** Creates an event bound to the event queue
2758  * @see EventQueue::event
2759  */
2760  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1, typename A2, typename A3, typename A4>
2761  Event<void(A0, A1, A2, A3, A4)> event(T *obj, R(T::*method)(B0, B1, B2, B3, A0, A1, A2, A3, A4), C0 c0, C1 c1, C2 c2, C3 c3);
2762 
2763  /** Creates an event bound to the event queue
2764  * @see EventQueue::event
2765  */
2766  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1, typename A2, typename A3, typename A4>
2767  Event<void(A0, A1, A2, A3, A4)> event(const T *obj, R(T::*method)(B0, B1, B2, B3, A0, A1, A2, A3, A4) const, C0 c0, C1 c1, C2 c2, C3 c3);
2768 
2769  /** Creates an event bound to the event queue
2770  * @see EventQueue::event
2771  */
2772  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1, typename A2, typename A3, typename A4>
2773  Event<void(A0, A1, A2, A3, A4)> event(volatile T *obj, R(T::*method)(B0, B1, B2, B3, A0, A1, A2, A3, A4) volatile, C0 c0, C1 c1, C2 c2, C3 c3);
2774 
2775  /** Creates an event bound to the event queue
2776  * @see EventQueue::event
2777  */
2778  template <typename T, typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1, typename A2, typename A3, typename A4>
2779  Event<void(A0, A1, A2, A3, A4)> event(const volatile T *obj, R(T::*method)(B0, B1, B2, B3, A0, A1, A2, A3, A4) const volatile, C0 c0, C1 c1, C2 c2, C3 c3);
2780 
2781  /** Creates an event bound to the event queue
2782  * @see EventQueue::event
2783  */
2784  template <typename R, typename B0, typename B1, typename B2, typename B3, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1, typename A2, typename A3, typename A4>
2785  Event<void(A0, A1, A2, A3, A4)> event(mbed::Callback<R(B0, B1, B2, B3, A0, A1, A2, A3, A4)> cb, C0 c0, C1 c1, C2 c2, C3 c3);
2786 
2787  /** Creates an event bound to the event queue
2788  * @see EventQueue::event
2789  */
2790  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>
2791  Event<void(A0, A1, A2, A3, A4)> event(R(*func)(B0, B1, B2, B3, B4, A0, A1, A2, A3, A4), C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
2792 
2793  /** Creates an event bound to the event queue
2794  * @see EventQueue::event
2795  */
2796  template <typename T, 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>
2797  Event<void(A0, A1, A2, A3, A4)> event(T *obj, R(T::*method)(B0, B1, B2, B3, B4, A0, A1, A2, A3, A4), C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
2798 
2799  /** Creates an event bound to the event queue
2800  * @see EventQueue::event
2801  */
2802  template <typename T, 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>
2803  Event<void(A0, A1, A2, A3, A4)> event(const T *obj, R(T::*method)(B0, B1, B2, B3, B4, A0, A1, A2, A3, A4) const, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
2804 
2805  /** Creates an event bound to the event queue
2806  * @see EventQueue::event
2807  */
2808  template <typename T, 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>
2809  Event<void(A0, A1, A2, A3, A4)> event(volatile T *obj, R(T::*method)(B0, B1, B2, B3, B4, A0, A1, A2, A3, A4) volatile, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
2810 
2811  /** Creates an event bound to the event queue
2812  * @see EventQueue::event
2813  */
2814  template <typename T, 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>
2815  Event<void(A0, A1, A2, A3, A4)> event(const volatile T *obj, R(T::*method)(B0, B1, B2, B3, B4, A0, A1, A2, A3, A4) const volatile, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4);
2816 
2817  /** Creates an event bound to the event queue
2818  * @see EventQueue::event
2819  */
2820  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>
2821  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);
2822 #endif
2823 
2824 protected:
2825 #if !defined(DOXYGEN_ONLY)
2826  template <typename F>
2827  friend class Event;
2828  struct equeue _equeue;
2829  mbed::Callback<void(int)> _update;
2830 
2831  // Function attributes
2832  template <typename F>
2833  static void function_call(void *p)
2834  {
2835  (*(F *)p)();
2836  }
2837 
2838  template <typename F>
2839  static void function_dtor(void *p)
2840  {
2841  ((F *)p)->~F();
2842  }
2843 
2844  // Context structures
2845  template <typename F>
2846  struct context00 {
2847  F f;
2848 
2849  context00(F f)
2850  : f(f) {}
2851 
2852  void operator()()
2853  {
2854  f();
2855  }
2856  };
2857 
2858  template <typename F, typename C0>
2859  struct context10 {
2860  F f;
2861  C0 c0;
2862 
2863  context10(F f, C0 c0)
2864  : f(f), c0(c0) {}
2865 
2866  void operator()()
2867  {
2868  f(c0);
2869  }
2870  };
2871 
2872  template <typename F, typename C0, typename C1>
2873  struct context20 {
2874  F f;
2875  C0 c0;
2876  C1 c1;
2877 
2878  context20(F f, C0 c0, C1 c1)
2879  : f(f), c0(c0), c1(c1) {}
2880 
2881  void operator()()
2882  {
2883  f(c0, c1);
2884  }
2885  };
2886 
2887  template <typename F, typename C0, typename C1, typename C2>
2888  struct context30 {
2889  F f;
2890  C0 c0;
2891  C1 c1;
2892  C2 c2;
2893 
2894  context30(F f, C0 c0, C1 c1, C2 c2)
2895  : f(f), c0(c0), c1(c1), c2(c2) {}
2896 
2897  void operator()()
2898  {
2899  f(c0, c1, c2);
2900  }
2901  };
2902 
2903  template <typename F, typename C0, typename C1, typename C2, typename C3>
2904  struct context40 {
2905  F f;
2906  C0 c0;
2907  C1 c1;
2908  C2 c2;
2909  C3 c3;
2910 
2911  context40(F f, C0 c0, C1 c1, C2 c2, C3 c3)
2912  : f(f), c0(c0), c1(c1), c2(c2), c3(c3) {}
2913 
2914  void operator()()
2915  {
2916  f(c0, c1, c2, c3);
2917  }
2918  };
2919 
2920  template <typename F, typename C0, typename C1, typename C2, typename C3, typename C4>
2921  struct context50 {
2922  F f;
2923  C0 c0;
2924  C1 c1;
2925  C2 c2;
2926  C3 c3;
2927  C4 c4;
2928 
2929  context50(F f, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4)
2930  : f(f), c0(c0), c1(c1), c2(c2), c3(c3), c4(c4) {}
2931 
2932  void operator()()
2933  {
2934  f(c0, c1, c2, c3, c4);
2935  }
2936  };
2937 
2938  template <typename F, typename A0>
2939  struct context01 {
2940  F f;
2941 
2942  context01(F f)
2943  : f(f) {}
2944 
2945  void operator()(A0 a0)
2946  {
2947  f(a0);
2948  }
2949  };
2950 
2951  template <typename F, typename C0, typename A0>
2952  struct context11 {
2953  F f;
2954  C0 c0;
2955 
2956  context11(F f, C0 c0)
2957  : f(f), c0(c0) {}
2958 
2959  void operator()(A0 a0)
2960  {
2961  f(c0, a0);
2962  }
2963  };
2964 
2965  template <typename F, typename C0, typename C1, typename A0>
2966  struct context21 {
2967  F f;
2968  C0 c0;
2969  C1 c1;
2970 
2971  context21(F f, C0 c0, C1 c1)
2972  : f(f), c0(c0), c1(c1) {}
2973 
2974  void operator()(A0 a0)
2975  {
2976  f(c0, c1, a0);
2977  }
2978  };
2979 
2980  template <typename F, typename C0, typename C1, typename C2, typename A0>
2981  struct context31 {
2982  F f;
2983  C0 c0;
2984  C1 c1;
2985  C2 c2;
2986 
2987  context31(F f, C0 c0, C1 c1, C2 c2)
2988  : f(f), c0(c0), c1(c1), c2(c2) {}
2989 
2990  void operator()(A0 a0)
2991  {
2992  f(c0, c1, c2, a0);
2993  }
2994  };
2995 
2996  template <typename F, typename C0, typename C1, typename C2, typename C3, typename A0>
2997  struct context41 {
2998  F f;
2999  C0 c0;
3000  C1 c1;
3001  C2 c2;
3002  C3 c3;
3003 
3004  context41(F f, C0 c0, C1 c1, C2 c2, C3 c3)
3005  : f(f), c0(c0), c1(c1), c2(c2), c3(c3) {}
3006 
3007  void operator()(A0 a0)
3008  {
3009  f(c0, c1, c2, c3, a0);
3010  }
3011  };
3012 
3013  template <typename F, typename C0, typename C1, typename C2, typename C3, typename C4, typename A0>
3014  struct context51 {
3015  F f;
3016  C0 c0;
3017  C1 c1;
3018  C2 c2;
3019  C3 c3;
3020  C4 c4;
3021 
3022  context51(F f, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4)
3023  : f(f), c0(c0), c1(c1), c2(c2), c3(c3), c4(c4) {}
3024 
3025  void operator()(A0 a0)
3026  {
3027  f(c0, c1, c2, c3, c4, a0);
3028  }
3029  };
3030 
3031  template <typename F, typename A0, typename A1>
3032  struct context02 {
3033  F f;
3034 
3035  context02(F f)
3036  : f(f) {}
3037 
3038  void operator()(A0 a0, A1 a1)
3039  {
3040  f(a0, a1);
3041  }
3042  };
3043 
3044  template <typename F, typename C0, typename A0, typename A1>
3045  struct context12 {
3046  F f;
3047  C0 c0;
3048 
3049  context12(F f, C0 c0)
3050  : f(f), c0(c0) {}
3051 
3052  void operator()(A0 a0, A1 a1)
3053  {
3054  f(c0, a0, a1);
3055  }
3056  };
3057 
3058  template <typename F, typename C0, typename C1, typename A0, typename A1>
3059  struct context22 {
3060  F f;
3061  C0 c0;
3062  C1 c1;
3063 
3064  context22(F f, C0 c0, C1 c1)
3065  : f(f), c0(c0), c1(c1) {}
3066 
3067  void operator()(A0 a0, A1 a1)
3068  {
3069  f(c0, c1, a0, a1);
3070  }
3071  };
3072 
3073  template <typename F, typename C0, typename C1, typename C2, typename A0, typename A1>
3074  struct context32 {
3075  F f;
3076  C0 c0;
3077  C1 c1;
3078  C2 c2;
3079 
3080  context32(F f, C0 c0, C1 c1, C2 c2)
3081  : f(f), c0(c0), c1(c1), c2(c2) {}
3082 
3083  void operator()(A0 a0, A1 a1)
3084  {
3085  f(c0, c1, c2, a0, a1);
3086  }
3087  };
3088 
3089  template <typename F, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1>
3090  struct context42 {
3091  F f;
3092  C0 c0;
3093  C1 c1;
3094  C2 c2;
3095  C3 c3;
3096 
3097  context42(F f, C0 c0, C1 c1, C2 c2, C3 c3)
3098  : f(f), c0(c0), c1(c1), c2(c2), c3(c3) {}
3099 
3100  void operator()(A0 a0, A1 a1)
3101  {
3102  f(c0, c1, c2, c3, a0, a1);
3103  }
3104  };
3105 
3106  template <typename F, typename C0, typename C1, typename C2, typename C3, typename C4, typename A0, typename A1>
3107  struct context52 {
3108  F f;
3109  C0 c0;
3110  C1 c1;
3111  C2 c2;
3112  C3 c3;
3113  C4 c4;
3114 
3115  context52(F f, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4)
3116  : f(f), c0(c0), c1(c1), c2(c2), c3(c3), c4(c4) {}
3117 
3118  void operator()(A0 a0, A1 a1)
3119  {
3120  f(c0, c1, c2, c3, c4, a0, a1);
3121  }
3122  };
3123 
3124  template <typename F, typename A0, typename A1, typename A2>
3125  struct context03 {
3126  F f;
3127 
3128  context03(F f)
3129  : f(f) {}
3130 
3131  void operator()(A0 a0, A1 a1, A2 a2)
3132  {
3133  f(a0, a1, a2);
3134  }
3135  };
3136 
3137  template <typename F, typename C0, typename A0, typename A1, typename A2>
3138  struct context13 {
3139  F f;
3140  C0 c0;
3141 
3142  context13(F f, C0 c0)
3143  : f(f), c0(c0) {}
3144 
3145  void operator()(A0 a0, A1 a1, A2 a2)
3146  {
3147  f(c0, a0, a1, a2);
3148  }
3149  };
3150 
3151  template <typename F, typename C0, typename C1, typename A0, typename A1, typename A2>
3152  struct context23 {
3153  F f;
3154  C0 c0;
3155  C1 c1;
3156 
3157  context23(F f, C0 c0, C1 c1)
3158  : f(f), c0(c0), c1(c1) {}
3159 
3160  void operator()(A0 a0, A1 a1, A2 a2)
3161  {
3162  f(c0, c1, a0, a1, a2);
3163  }
3164  };
3165 
3166  template <typename F, typename C0, typename C1, typename C2, typename A0, typename A1, typename A2>
3167  struct context33 {
3168  F f;
3169  C0 c0;
3170  C1 c1;
3171  C2 c2;
3172 
3173  context33(F f, C0 c0, C1 c1, C2 c2)
3174  : f(f), c0(c0), c1(c1), c2(c2) {}
3175 
3176  void operator()(A0 a0, A1 a1, A2 a2)
3177  {
3178  f(c0, c1, c2, a0, a1, a2);
3179  }
3180  };
3181 
3182  template <typename F, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1, typename A2>
3183  struct context43 {
3184  F f;
3185  C0 c0;
3186  C1 c1;
3187  C2 c2;
3188  C3 c3;
3189 
3190  context43(F f, C0 c0, C1 c1, C2 c2, C3 c3)
3191  : f(f), c0(c0), c1(c1), c2(c2), c3(c3) {}
3192 
3193  void operator()(A0 a0, A1 a1, A2 a2)
3194  {
3195  f(c0, c1, c2, c3, a0, a1, a2);
3196  }
3197  };
3198 
3199  template <typename F, typename C0, typename C1, typename C2, typename C3, typename C4, typename A0, typename A1, typename A2>
3200  struct context53 {
3201  F f;
3202  C0 c0;
3203  C1 c1;
3204  C2 c2;
3205  C3 c3;
3206  C4 c4;
3207 
3208  context53(F f, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4)
3209  : f(f), c0(c0), c1(c1), c2(c2), c3(c3), c4(c4) {}
3210 
3211  void operator()(A0 a0, A1 a1, A2 a2)
3212  {
3213  f(c0, c1, c2, c3, c4, a0, a1, a2);
3214  }
3215  };
3216 
3217  template <typename F, typename A0, typename A1, typename A2, typename A3>
3218  struct context04 {
3219  F f;
3220 
3221  context04(F f)
3222  : f(f) {}
3223 
3224  void operator()(A0 a0, A1 a1, A2 a2, A3 a3)
3225  {
3226  f(a0, a1, a2, a3);
3227  }
3228  };
3229 
3230  template <typename F, typename C0, typename A0, typename A1, typename A2, typename A3>
3231  struct context14 {
3232  F f;
3233  C0 c0;
3234 
3235  context14(F f, C0 c0)
3236  : f(f), c0(c0) {}
3237 
3238  void operator()(A0 a0, A1 a1, A2 a2, A3 a3)
3239  {
3240  f(c0, a0, a1, a2, a3);
3241  }
3242  };
3243 
3244  template <typename F, typename C0, typename C1, typename A0, typename A1, typename A2, typename A3>
3245  struct context24 {
3246  F f;
3247  C0 c0;
3248  C1 c1;
3249 
3250  context24(F f, C0 c0, C1 c1)
3251  : f(f), c0(c0), c1(c1) {}
3252 
3253  void operator()(A0 a0, A1 a1, A2 a2, A3 a3)
3254  {
3255  f(c0, c1, a0, a1, a2, a3);
3256  }
3257  };
3258 
3259  template <typename F, typename C0, typename C1, typename C2, typename A0, typename A1, typename A2, typename A3>
3260  struct context34 {
3261  F f;
3262  C0 c0;
3263  C1 c1;
3264  C2 c2;
3265 
3266  context34(F f, C0 c0, C1 c1, C2 c2)
3267  : f(f), c0(c0), c1(c1), c2(c2) {}
3268 
3269  void operator()(A0 a0, A1 a1, A2 a2, A3 a3)
3270  {
3271  f(c0, c1, c2, a0, a1, a2, a3);
3272  }
3273  };
3274 
3275  template <typename F, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1, typename A2, typename A3>
3276  struct context44 {
3277  F f;
3278  C0 c0;
3279  C1 c1;
3280  C2 c2;
3281  C3 c3;
3282 
3283  context44(F f, C0 c0, C1 c1, C2 c2, C3 c3)
3284  : f(f), c0(c0), c1(c1), c2(c2), c3(c3) {}
3285 
3286  void operator()(A0 a0, A1 a1, A2 a2, A3 a3)
3287  {
3288  f(c0, c1, c2, c3, a0, a1, a2, a3);
3289  }
3290  };
3291 
3292  template <typename F, typename C0, typename C1, typename C2, typename C3, typename C4, typename A0, typename A1, typename A2, typename A3>
3293  struct context54 {
3294  F f;
3295  C0 c0;
3296  C1 c1;
3297  C2 c2;
3298  C3 c3;
3299  C4 c4;
3300 
3301  context54(F f, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4)
3302  : f(f), c0(c0), c1(c1), c2(c2), c3(c3), c4(c4) {}
3303 
3304  void operator()(A0 a0, A1 a1, A2 a2, A3 a3)
3305  {
3306  f(c0, c1, c2, c3, c4, a0, a1, a2, a3);
3307  }
3308  };
3309 
3310  template <typename F, typename A0, typename A1, typename A2, typename A3, typename A4>
3311  struct context05 {
3312  F f;
3313 
3314  context05(F f)
3315  : f(f) {}
3316 
3317  void operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)
3318  {
3319  f(a0, a1, a2, a3, a4);
3320  }
3321  };
3322 
3323  template <typename F, typename C0, typename A0, typename A1, typename A2, typename A3, typename A4>
3324  struct context15 {
3325  F f;
3326  C0 c0;
3327 
3328  context15(F f, C0 c0)
3329  : f(f), c0(c0) {}
3330 
3331  void operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)
3332  {
3333  f(c0, a0, a1, a2, a3, a4);
3334  }
3335  };
3336 
3337  template <typename F, typename C0, typename C1, typename A0, typename A1, typename A2, typename A3, typename A4>
3338  struct context25 {
3339  F f;
3340  C0 c0;
3341  C1 c1;
3342 
3343  context25(F f, C0 c0, C1 c1)
3344  : f(f), c0(c0), c1(c1) {}
3345 
3346  void operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)
3347  {
3348  f(c0, c1, a0, a1, a2, a3, a4);
3349  }
3350  };
3351 
3352  template <typename F, typename C0, typename C1, typename C2, typename A0, typename A1, typename A2, typename A3, typename A4>
3353  struct context35 {
3354  F f;
3355  C0 c0;
3356  C1 c1;
3357  C2 c2;
3358 
3359  context35(F f, C0 c0, C1 c1, C2 c2)
3360  : f(f), c0(c0), c1(c1), c2(c2) {}
3361 
3362  void operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)
3363  {
3364  f(c0, c1, c2, a0, a1, a2, a3, a4);
3365  }
3366  };
3367 
3368  template <typename F, typename C0, typename C1, typename C2, typename C3, typename A0, typename A1, typename A2, typename A3, typename A4>
3369  struct context45 {
3370  F f;
3371  C0 c0;
3372  C1 c1;
3373  C2 c2;
3374  C3 c3;
3375 
3376  context45(F f, C0 c0, C1 c1, C2 c2, C3 c3)
3377  : f(f), c0(c0), c1(c1), c2(c2), c3(c3) {}
3378 
3379  void operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)
3380  {
3381  f(c0, c1, c2, c3, a0, a1, a2, a3, a4);
3382  }
3383  };
3384 
3385  template <typename F, typename C0, typename C1, typename C2, typename C3, typename C4, typename A0, typename A1, typename A2, typename A3, typename A4>
3386  struct context55 {
3387  F f;
3388  C0 c0;
3389  C1 c1;
3390  C2 c2;
3391  C3 c3;
3392  C4 c4;
3393 
3394  context55(F f, C0 c0, C1 c1, C2 c2, C3 c3, C4 c4)
3395  : f(f), c0(c0), c1(c1), c2(c2), c3(c3), c4(c4) {}
3396 
3397  void operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4)
3398  {
3399  f(c0, c1, c2, c3, c4, a0, a1, a2, a3, a4);
3400  }
3401  };
3402 #endif //!defined(DOXYGEN_ONLY)
3403 };
3404 
3405 }
3406 
3407 #endif
3408 
void dispatch_forever()
Dispatch events without a timeout.
Definition: EventQueue.h:93
int time_left(int id)
Query how much time is left for delayed event.
void break_dispatch()
Break out of a running event loop.
EventQueue.
Definition: EventQueue.h:52
EventQueue(unsigned size=(32 *((sizeof(struct equeue_event)+2 *sizeof(void *))-2 *sizeof(void *)+sizeof(mbed::Callback< void()>))), unsigned char *buffer=NULL)
Create an EventQueue.
Event< void(Args...)> event(R(*func)(BoundArgs...), Args...args)
Creates an event bound to the event queue.
int chain(EventQueue *target)
Chain an event queue onto another event queue.
Prevents generation of copy constructor and copy assignment operator in derived classes.
Definition: NonCopyable.h:168
Callback< R()> callback(R(*func)()=0)
Create a callback class with type inferred from the arguments.
Definition: Callback.h:3848
void cancel(int id)
Cancel an in-flight event.
unsigned tick()
Millisecond counter.
Definition: equeue.h:58
void background(mbed::Callback< void(int)> update)
Background an event queue onto a single-shot timer-interrupt.
int call(F f, Args...args)
Calls an event on the queue.
~EventQueue()
Destroy an EventQueue.
Callback class based on template specialization.
Definition: Callback.h:39
int call_every(int ms, F f, Args...args)
Calls an event on the queue periodically.
int call_in(int ms, Args...args)
Calls an event on the queue after a specified delay.
void dispatch(int ms=-1)
Dispatch events.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.