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 (duration d)
 Configure the delay of an event. More...
 
void delay (int d)
 Configure the delay of an event. More...
 
void period (duration p)
 Configure the period of an event. More...
 
void period (int p)
 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 47 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 61 of file Event.h.

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

Copy constructor for events.

Definition at line 83 of file Event.h.

~Event ( )

Destructor for events.

Definition at line 106 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 279 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 286 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 293 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 300 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 307 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 314 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 321 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 328 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 335 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 342 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 349 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 356 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 363 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 370 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 377 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 384 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 391 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 398 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 405 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 412 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 419 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 188 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 224 of file Event.h.

void delay ( duration  d)

Configure the delay of an event.

Parameters
dMillisecond delay before dispatching the event

Definition at line 121 of file Event.h.

void delay ( int  d)

Configure the delay of an event.

Deprecated:
Pass a chrono duration, not an integer millisecond count.

For example use 5s rather than 5000.

Parameters
dMillisecond delay before dispatching the event

Definition at line 134 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 198 of file Event.h.

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

Assignment operator for events.

Definition at line 94 of file Event.h.

void period ( duration  p)

Configure the period of an event.

Parameters
pMillisecond period for repeatedly dispatching an event

Definition at line 143 of file Event.h.

void period ( int  p)

Configure the period of an event.

Deprecated:
Pass a chrono duration, not an integer millisecond count.

For example use 5s rather than 5000.

Parameters
pMillisecond period for repeatedly dispatching an event

Definition at line 156 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 174 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 208 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.