5.2.1 - Updated I2C files

Dependents:   mbed-TFT-example-NCS36510 mbed-Accelerometer-example-NCS36510 mbed-Accelerometer-example-NCS36510

Committer:
jacobjohnson
Date:
Mon Feb 27 17:45:05 2017 +0000
Revision:
1:f30bdcd2b33b
Parent:
0:098463de4c5d
changed the inputscale from 1 to 7 in analogin_api.c.  This will need to be changed later, and accessed from the main level, but for now this allows the  adc to read a value from 0 to 3.7V, instead of just up to 1V.;

Who changed what in which revision?

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