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