Note! This project has moved to github.com/armmbed/mbed-events

Dependents:   SimpleHTTPExample

Embed: (wiki syntax)

« Back to documentation index

Event< void(A0, A1, A2, A3)> Class Template Reference

Event< void(A0, A1, A2, A3)> Class Template Reference

Pendable event class. More...

#include <Event.h>

Public Member Functions

 Event (EventQueue *queue=0, FuncPtr< void(A0, A1, A2, A3)> func=0)
 Create an event bound to a queue.
template<typename T , typename M >
 Event (EventQueue *queue, T *obj, M method)
 Create an event bound to a queue.
void attach (EventQueue *queue)
 Attach an event to a queue.
void attach (FuncPtr< void(A0, A1, A2, A3)> func)
 Attach a callback to an event.
template<typename T , typename M >
void attach (T *obj, M method)
 Attach a callback to an event.
void attach (EventQueue *queue, FuncPtr< void(A0, A1, A2, A3)> func)
 Attach a func to an event.
template<typename T , typename M >
void attach (EventQueue *queue, T *obj, M method)
 Attach an event to a queue.
void delay (int ms)
 Set delay for when the event is dispatched after it is posted.
void period (int ms)
 Set event to repeat periodically after it is posted.
void tolerance (int ms)
 Set tolerance hint on when the event must be called, defaults to 0.
bool trigger (A0 a0, A1 a1, A2 a2, A3 a3, int ms=-1)
 Post the event onto the bound queue.
void call (A0 a0, A1 a1, A2 a2, A3 a3)
 Post the event onto the bound queue.
void operator() (A0 a0, A1 a1, A2 a2, A3 a3)
 Post the event onto the bound queue.
 operator bool () const
 Test if event has been bound.

Static Public Member Functions

static void thunk (void *data, A0 a0, A1 a1, A2 a2, A3 a3)
 Static thunk for passing as C-style function.

Detailed Description

template<typename A0, typename A1, typename A2, typename A3>
class Event< void(A0, A1, A2, A3)>

Pendable event class.

Definition at line 142 of file Event.h.


Constructor & Destructor Documentation

Event ( EventQueue queue = 0,
FuncPtr< void(A0, A1, A2, A3)>  func = 0 
)

Create an event bound to a queue.

Definition at line 146 of file Event.h.

Event ( EventQueue queue,
T *  obj,
method 
)

Create an event bound to a queue.

Definition at line 155 of file Event.h.


Member Function Documentation

void attach ( EventQueue queue )

Attach an event to a queue.

Definition at line 163 of file Event.h.

void attach ( FuncPtr< void(A0, A1, A2, A3)>  func )

Attach a callback to an event.

Definition at line 169 of file Event.h.

void attach ( EventQueue queue,
FuncPtr< void(A0, A1, A2, A3)>  func 
)

Attach a func to an event.

Definition at line 182 of file Event.h.

void attach ( EventQueue queue,
T *  obj,
method 
)

Attach an event to a queue.

Definition at line 190 of file Event.h.

void attach ( T *  obj,
method 
)

Attach a callback to an event.

Definition at line 176 of file Event.h.

void call ( A0  a0,
A1  a1,
A2  a2,
A3  a3 
)

Post the event onto the bound queue.

Definition at line 228 of file Event.h.

void delay ( int  ms )

Set delay for when the event is dispatched after it is posted.

Parameters:
msDelay in milliseconds

Definition at line 198 of file Event.h.

operator bool (  ) const

Test if event has been bound.

Definition at line 240 of file Event.h.

void operator() ( A0  a0,
A1  a1,
A2  a2,
A3  a3 
)

Post the event onto the bound queue.

Definition at line 234 of file Event.h.

void period ( int  ms )

Set event to repeat periodically after it is posted.

Parameters:
msPeriod in milliseconds

Definition at line 205 of file Event.h.

static void thunk ( void *  data,
A0  a0,
A1  a1,
A2  a2,
A3  a3 
) [static]

Static thunk for passing as C-style function.

Parameters:
dataEvent to dispatch passed as void pointer

Definition at line 247 of file Event.h.

void tolerance ( int  ms )

Set tolerance hint on when the event must be called, defaults to 0.

Parameters:
msTolerance in milliseconds

Definition at line 212 of file Event.h.

bool trigger ( A0  a0,
A1  a1,
A2  a2,
A3  a3,
int  ms = -1 
)

Post the event onto the bound queue.

Parameters:
msMax time to wait if memory is not available in milliseconds
Returns:
True if the event was posted successfully

Definition at line 220 of file Event.h.