v1.1.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Modules Pages
Public Member Functions | List of all members
Sifteo::NeighborEventVector< tID > Struct Template Reference

Implementation for a single neighbor 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, unsigned, unsigned, unsigned), tContext context) const
 Set this Vector to a function with context pointer. More...
 
void set (void(*handler)(void *, unsigned, unsigned, unsigned, unsigned)) const
 Set this Vector to a bare function. More...
 
template<typename tClass >
void set (void(tClass::*handler)(unsigned, unsigned, unsigned, 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...
 

Detailed Description

template<_SYSVectorID tID>
struct Sifteo::NeighborEventVector< tID >

Implementation for a single neighbor event vector.

Instances of this template are found in the Events namespace. Typically you should not create instances of this object elsewhere.

Member Function Documentation

template<_SYSVectorID tID>
template<typename tContext >
void Sifteo::NeighborEventVector< tID >::set ( void(*)(tContext, unsigned, unsigned, unsigned, unsigned)  handler,
tContext  context 
) const
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 firstID, unsigned firstSide, unsigned secondID, unsigned secondSide);

The IDs here are castable to NeighborID objects, and the Sides are using the standard Side enumeration.

template<_SYSVectorID tID>
void Sifteo::NeighborEventVector< tID >::set ( void(*)(void *, unsigned, unsigned, unsigned, unsigned)  handler) const
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 firstID, unsigned firstSide, unsigned secondID, unsigned secondSide);

The IDs here are castable to NeighborID objects, and the Sides are using the standard Side enumeration.

template<_SYSVectorID tID>
void Sifteo::NeighborEventVector< tID >::unset ( ) const
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.


The documentation for this struct was generated from the following file: