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

Dependents:   SimpleHTTPExample

Embed: (wiki syntax)

« Back to documentation index

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

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

Pendable event class. More...

#include <Event.h>

Public Member Functions

 Event (EventQueue *queue=0, FuncPtr< void(A0, A1)> 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)> 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)> 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, int ms=-1)
 Post the event onto the bound queue.
void call (A0 a0, A1 a1)
 Post the event onto the bound queue.
void operator() (A0 a0, A1 a1)
 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)
 Static thunk for passing as C-style function.

Detailed Description

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

Pendable event class.

Definition at line 384 of file Event.h.


Constructor & Destructor Documentation

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

Create an event bound to a queue.

Definition at line 388 of file Event.h.

Event ( EventQueue queue,
T *  obj,
method 
)

Create an event bound to a queue.

Definition at line 397 of file Event.h.


Member Function Documentation

void attach ( EventQueue queue )

Attach an event to a queue.

Definition at line 405 of file Event.h.

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

Attach a callback to an event.

Definition at line 411 of file Event.h.

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

Attach a func to an event.

Definition at line 424 of file Event.h.

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

Attach an event to a queue.

Definition at line 432 of file Event.h.

void attach ( T *  obj,
method 
)

Attach a callback to an event.

Definition at line 418 of file Event.h.

void call ( A0  a0,
A1  a1 
)

Post the event onto the bound queue.

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

operator bool (  ) const

Test if event has been bound.

Definition at line 482 of file Event.h.

void operator() ( A0  a0,
A1  a1 
)

Post the event onto the bound queue.

Definition at line 476 of file Event.h.

void period ( int  ms )

Set event to repeat periodically after it is posted.

Parameters:
msPeriod in milliseconds

Definition at line 447 of file Event.h.

static void thunk ( void *  data,
A0  a0,
A1  a1 
) [static]

Static thunk for passing as C-style function.

Parameters:
dataEvent to dispatch passed as void pointer

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

bool trigger ( A0  a0,
A1  a1,
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 462 of file Event.h.