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 50 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 64 of file Event.h.

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

Copy constructor for events.

Definition at line 86 of file Event.h.

~Event ( )

Destructor for events.

Definition at line 109 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 295 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 302 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 309 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 316 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 323 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 330 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 337 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 344 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 351 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 358 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 365 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 372 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 379 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 386 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 393 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 400 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 407 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 414 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 421 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 428 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 435 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 204 of file Event.h.

void cancel ( ) const

Cancels the most recently posted event.

Attempts to cancel the most recently posted event. It is not 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 240 of file Event.h.

void delay ( duration  d)

Configure the delay of an event.

Parameters
dDelay (in milliseconds) before dispatching the event, expressed as a Chrono duration. E.g. delay(50ms)

Definition at line 125 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 138 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 214 of file Event.h.

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

Assignment operator for events.

Definition at line 97 of file Event.h.

void period ( duration  p)

Configure the period of an event.

Parameters
pPeriod (in milliseconds) for repeatedly dispatching an event, expressed as a Chrono duration. Period must be either non_periodic or > 0ms. If an invalid period is supplied then a default non_periodic value is used. E.g. period(200ms)

Definition at line 150 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 172 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 190 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 224 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.