Implementation for a single event vector. More...
#include <sifteo/event.h>
Public Member Functions | |
void * | context () const |
Return the currently set context object, as a void pointer. | |
void * | handler () const |
Return the currently set handler function, as a void pointer. | |
template<typename tContext > | |
void | set (void(*handler)(tContext, unsigned), tContext context) const |
Set this Vector to a function with context pointer. More... | |
void | set (void(*handler)(void *, unsigned)) const |
Set this Vector to a bare function. More... | |
template<typename tClass > | |
void | set (void(tClass::*handler)(unsigned), tClass *cls) const |
Set this event vector to an instance method, given a class method pointer and an instance of that class. | |
void | unset () const |
Disable this event vector. More... | |
Implementation for a single event vector.
Instances of this template are found in the Events namespace. Typically you should not create instances of this object elsewhere.
|
inline |
Set this Vector to a function with context pointer.
Requires a closure consisting of an arbitrary pointer-sized context value, and a function pointer of the form:
void handler(ContextType c, unsigned parameter);
For Cube events, the parameter is the Cube ID that originated the event. For Base events, the parameter has different meanings based on the event type.
|
inline |
Set this Vector to a bare function.
Set this event vector to a bare function which requires no context. It must still take a dummy void* placeholder argument:
void handler(void*, unsigned parameter);
For Cube events, the parameter is the Cube ID that originated the event. For Base events, the parameter has different meanings based on the event type.
|
inline |
Disable this event vector.
This acts like a no-op handler was registered, but of course it's more efficient than setting an actual no-op handler.
Sifteo SDK v1.1.0 (see all versions)
Last updated Tue Dec 23 2014, by Doxygen