Mistake on this page?
Report an issue in GitHub or email us
Data Structures | Public Member Functions | Static Public Member Functions
Event< void(ArgTs...)> Class Template Reference

Event. More...

#include <Event.h>

Public Member Functions

template<typename F >
 Event (EventQueue *q, F f)
 Create an event. More...
 
 Event (const Event &e)
 Copy constructor for events. More...
 
Eventoperator= (const Event &that)
 Assignment operator for events. More...
 
 ~Event ()
 Destructor for events. More...
 
void delay (int delay)
 Configure the delay of an event. More...
 
void period (int period)
 Configure the period of an event. More...
 
int post (ArgTs...args) const
 Posts an event onto the underlying event queue. More...
 
void call (ArgTs...args) const
 Posts an event onto the underlying event queue, returning void. More...
 
void operator() (ArgTs...args) const
 Posts an event onto the underlying event queue, returning void. More...
 
void cancel () const
 Cancels the most recently posted event. More...
 
template<typename F , typename... ContextArgTs>
 Event (EventQueue *q, F f, ContextArgTs...context_args)
 Create an event. More...
 
template<typename T , typename R , typename B0 >
 Event (EventQueue *q, T *obj, R(T::*method)(B0, ArgTs...), B0 b0)
 Create an event. More...
 
template<typename T , typename R , typename B0 >
 Event (EventQueue *q, const T *obj, R(T::*method)(B0, ArgTs...) const, B0 b0)
 Create an event. More...
 
template<typename T , typename R , typename B0 >
 Event (EventQueue *q, volatile T *obj, R(T::*method)(B0, ArgTs...) volatile, B0 b0)
 Create an event. More...
 
template<typename T , typename R , typename B0 >
 Event (EventQueue *q, const volatile T *obj, R(T::*method)(B0, ArgTs...) const volatile, B0 b0)
 Create an event. More...
 
template<typename T , typename R , typename B0 , typename B1 >
 Event (EventQueue *q, T *obj, R(T::*method)(B0, B1, ArgTs...), B0 b0, B1 b1)
 Create an event. More...
 
template<typename T , typename R , typename B0 , typename B1 >
 Event (EventQueue *q, const T *obj, R(T::*method)(B0, B1, ArgTs...) const, B0 b0, B1 b1)
 Create an event. More...
 
template<typename T , typename R , typename B0 , typename B1 >
 Event (EventQueue *q, volatile T *obj, R(T::*method)(B0, B1, ArgTs...) volatile, B0 b0, B1 b1)
 Create an event. More...
 
template<typename T , typename R , typename B0 , typename B1 >
 Event (EventQueue *q, const volatile T *obj, R(T::*method)(B0, B1, ArgTs...) const volatile, B0 b0, B1 b1)
 Create an event. More...
 
template<typename T , typename R , typename B0 , typename B1 , typename B2 >
 Event (EventQueue *q, T *obj, R(T::*method)(B0, B1, B2, ArgTs...), B0 b0, B1 b1, B2 b2)
 Create an event. More...
 
template<typename T , typename R , typename B0 , typename B1 , typename B2 >
 Event (EventQueue *q, const T *obj, R(T::*method)(B0, B1, B2, ArgTs...) const, B0 b0, B1 b1, B2 b2)
 Create an event. More...
 
template<typename T , typename R , typename B0 , typename B1 , typename B2 >
 Event (EventQueue *q, volatile T *obj, R(T::*method)(B0, B1, B2, ArgTs...) volatile, B0 b0, B1 b1, B2 b2)
 Create an event. More...
 
template<typename T , typename R , typename B0 , typename B1 , typename B2 >
 Event (EventQueue *q, const volatile T *obj, R(T::*method)(B0, B1, B2, ArgTs...) const volatile, B0 b0, B1 b1, B2 b2)
 Create an event. More...
 
template<typename T , typename R , typename B0 , typename B1 , typename B2 , typename B3 >
 Event (EventQueue *q, T *obj, R(T::*method)(B0, B1, B2, B3, ArgTs...), B0 b0, B1 b1, B2 b2, B3 b3)
 Create an event. More...
 
template<typename T , typename R , typename B0 , typename B1 , typename B2 , typename B3 >
 Event (EventQueue *q, const T *obj, R(T::*method)(B0, B1, B2, B3, ArgTs...) const, B0 b0, B1 b1, B2 b2, B3 b3)
 Create an event. More...
 
template<typename T , typename R , typename B0 , typename B1 , typename B2 , typename B3 >
 Event (EventQueue *q, volatile T *obj, R(T::*method)(B0, B1, B2, B3, ArgTs...) volatile, B0 b0, B1 b1, B2 b2, B3 b3)
 Create an event. More...
 
template<typename T , typename R , typename B0 , typename B1 , typename B2 , typename B3 >
 Event (EventQueue *q, const volatile T *obj, R(T::*method)(B0, B1, B2, B3, ArgTs...) const volatile, B0 b0, B1 b1, B2 b2, B3 b3)
 Create an event. More...
 
template<typename T , typename R , typename B0 , typename B1 , typename B2 , typename B3 , typename B4 >
 Event (EventQueue *q, T *obj, R(T::*method)(B0, B1, B2, B3, B4, ArgTs...), B0 b0, B1 b1, B2 b2, B3 b3, B4 b4)
 Create an event. More...
 
template<typename T , typename R , typename B0 , typename B1 , typename B2 , typename B3 , typename B4 >
 Event (EventQueue *q, const T *obj, R(T::*method)(B0, B1, B2, B3, B4, ArgTs...) const, B0 b0, B1 b1, B2 b2, B3 b3, B4 b4)
 Create an event. More...
 
template<typename T , typename R , typename B0 , typename B1 , typename B2 , typename B3 , typename B4 >
 Event (EventQueue *q, volatile T *obj, R(T::*method)(B0, B1, B2, B3, B4, ArgTs...) volatile, B0 b0, B1 b1, B2 b2, B3 b3, B4 b4)
 Create an event. More...
 
template<typename T , typename R , typename B0 , typename B1 , typename B2 , typename B3 , typename B4 >
 Event (EventQueue *q, const volatile T *obj, R(T::*method)(B0, B1, B2, B3, B4, ArgTs...) const volatile, B0 b0, B1 b1, B2 b2, B3 b3, B4 b4)
 Create an event. More...
 

Static Public Member Functions

static void thunk (void *func, ArgTs...args)
 Static thunk for passing as C-style function. More...
 

Detailed Description

template<typename... ArgTs>
class events::Event< void(ArgTs...)>

Event.

Representation of an event for fine-grain dispatch control

Definition at line 46 of file Event.h.

Constructor & Destructor Documentation

Event ( EventQueue q,
f 
)

Create an event.

Constructs an event bound to the specified event queue. The specified callback acts as the target for the event and is executed in the context of the event queue's dispatch loop once posted.

Parameters
qEvent queue to dispatch on
fFunction to execute when the event is dispatched

Definition at line 58 of file Event.h.

Event ( const Event< void(ArgTs...)> &  e)

Copy constructor for events.

Definition at line 80 of file Event.h.

~Event ( )

Destructor for events.

Definition at line 103 of file Event.h.

Event ( EventQueue q,
f,
ContextArgTs...  context_args 
)

Create an event.

Parameters
qEvent queue to dispatch on
fFunction to execute when the event is dispatched
context_argsArguments to bind to the callback, these arguments are allocated on an IRQ-safe allocator from the event queue's memory pool. Must be type-compatible with bound_args, the arguments to the underlying callback.

Definition at line 254 of file Event.h.

Event ( EventQueue q,
T *  obj,
R(T::*)(B0, ArgTs...)  method,
B0  b0 
)

Create an event.

See also
Event::Event

Definition at line 261 of file Event.h.

Event ( EventQueue q,
const T *  obj,
R(T::*)(B0, ArgTs...) const  method,
B0  b0 
)

Create an event.

See also
Event::Event

Definition at line 268 of file Event.h.

Event ( EventQueue q,
volatile T *  obj,
R(T::*)(B0, ArgTs...) volatile  method,
B0  b0 
)

Create an event.

See also
Event::Event

Definition at line 275 of file Event.h.

Event ( EventQueue q,
const volatile T *  obj,
R(T::*)(B0, ArgTs...) const volatile  method,
B0  b0 
)

Create an event.

See also
Event::Event

Definition at line 282 of file Event.h.

Event ( EventQueue q,
T *  obj,
R(T::*)(B0, B1, ArgTs...)  method,
B0  b0,
B1  b1 
)

Create an event.

See also
Event::Event

Definition at line 289 of file Event.h.

Event ( EventQueue q,
const T *  obj,
R(T::*)(B0, B1, ArgTs...) const  method,
B0  b0,
B1  b1 
)

Create an event.

See also
Event::Event

Definition at line 296 of file Event.h.

Event ( EventQueue q,
volatile T *  obj,
R(T::*)(B0, B1, ArgTs...) volatile  method,
B0  b0,
B1  b1 
)

Create an event.

See also
Event::Event

Definition at line 303 of file Event.h.

Event ( EventQueue q,
const volatile T *  obj,
R(T::*)(B0, B1, ArgTs...) const volatile  method,
B0  b0,
B1  b1 
)

Create an event.

See also
Event::Event

Definition at line 310 of file Event.h.

Event ( EventQueue q,
T *  obj,
R(T::*)(B0, B1, B2, ArgTs...)  method,
B0  b0,
B1  b1,
B2  b2 
)

Create an event.

See also
Event::Event

Definition at line 317 of file Event.h.

Event ( EventQueue q,
const T *  obj,
R(T::*)(B0, B1, B2, ArgTs...) const  method,
B0  b0,
B1  b1,
B2  b2 
)

Create an event.

See also
Event::Event

Definition at line 324 of file Event.h.

Event ( EventQueue q,
volatile T *  obj,
R(T::*)(B0, B1, B2, ArgTs...) volatile  method,
B0  b0,
B1  b1,
B2  b2 
)

Create an event.

See also
Event::Event

Definition at line 331 of file Event.h.

Event ( EventQueue q,
const volatile T *  obj,
R(T::*)(B0, B1, B2, ArgTs...) const volatile  method,
B0  b0,
B1  b1,
B2  b2 
)

Create an event.

See also
Event::Event

Definition at line 338 of file Event.h.

Event ( EventQueue q,
T *  obj,
R(T::*)(B0, B1, B2, B3, ArgTs...)  method,
B0  b0,
B1  b1,
B2  b2,
B3  b3 
)

Create an event.

See also
Event::Event

Definition at line 345 of file Event.h.

Event ( EventQueue q,
const T *  obj,
R(T::*)(B0, B1, B2, B3, ArgTs...) const  method,
B0  b0,
B1  b1,
B2  b2,
B3  b3 
)

Create an event.

See also
Event::Event

Definition at line 352 of file Event.h.

Event ( EventQueue q,
volatile T *  obj,
R(T::*)(B0, B1, B2, B3, ArgTs...) volatile  method,
B0  b0,
B1  b1,
B2  b2,
B3  b3 
)

Create an event.

See also
Event::Event

Definition at line 359 of file Event.h.

Event ( EventQueue q,
const volatile T *  obj,
R(T::*)(B0, B1, B2, B3, ArgTs...) const volatile  method,
B0  b0,
B1  b1,
B2  b2,
B3  b3 
)

Create an event.

See also
Event::Event

Definition at line 366 of file Event.h.

Event ( EventQueue q,
T *  obj,
R(T::*)(B0, B1, B2, B3, B4, ArgTs...)  method,
B0  b0,
B1  b1,
B2  b2,
B3  b3,
B4  b4 
)

Create an event.

See also
Event::Event

Definition at line 373 of file Event.h.

Event ( EventQueue q,
const T *  obj,
R(T::*)(B0, B1, B2, B3, B4, ArgTs...) const  method,
B0  b0,
B1  b1,
B2  b2,
B3  b3,
B4  b4 
)

Create an event.

See also
Event::Event

Definition at line 380 of file Event.h.

Event ( EventQueue q,
volatile T *  obj,
R(T::*)(B0, B1, B2, B3, B4, ArgTs...) volatile  method,
B0  b0,
B1  b1,
B2  b2,
B3  b3,
B4  b4 
)

Create an event.

See also
Event::Event

Definition at line 387 of file Event.h.

Event ( EventQueue q,
const volatile T *  obj,
R(T::*)(B0, B1, B2, B3, B4, ArgTs...) const volatile  method,
B0  b0,
B1  b1,
B2  b2,
B3  b3,
B4  b4 
)

Create an event.

See also
Event::Event

Definition at line 394 of file Event.h.

Member Function Documentation

void call ( ArgTs...  args) const

Posts an event onto the underlying event queue, returning void.

Parameters
argsArguments to pass to the event

Definition at line 163 of file Event.h.

void cancel ( ) const

Cancels the most recently posted event.

Attempts to cancel the most recently posted event. It is safe to call cancel after an event has already been dispatched.

The cancel function is IRQ safe.

If called while the event queue's dispatch loop is active, the cancel function does not guarantee that the event will not execute after it returns, as the event may have already begun executing.

Definition at line 199 of file Event.h.

void delay ( int  delay)

Configure the delay of an event.

Parameters
delayMillisecond delay before dispatching the event

Definition at line 118 of file Event.h.

void operator() ( ArgTs...  args) const

Posts an event onto the underlying event queue, returning void.

Parameters
argsArguments to pass to the event

Definition at line 173 of file Event.h.

Event& operator= ( const Event< void(ArgTs...)> &  that)

Assignment operator for events.

Definition at line 91 of file Event.h.

void period ( int  period)

Configure the period of an event.

Parameters
periodMillisecond period for repeatedly dispatching an event

Definition at line 129 of file Event.h.

int post ( ArgTs...  args) const

Posts an event onto the underlying event queue.

The event is posted to the underlying queue and is executed in the context of the event queue's dispatch loop.

The post function is IRQ safe and can act as a mechanism for moving events out of IRQ contexts.

Parameters
argsArguments to pass to the event
Returns
A unique id that represents the posted event and can be passed to EventQueue::cancel, or an id of 0 if there is not enough memory to allocate the event.

Definition at line 149 of file Event.h.

static void thunk ( void *  func,
ArgTs...  args 
)
static

Static thunk for passing as C-style function.

Parameters
funcEvent to call passed as a void pointer
argsArguments to pass to the event

Definition at line 183 of file Event.h.

Important Information for this Arm website

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