iFun Engine API  1.0.0-b2601
Great Technology for Great Games
 All Classes Files Functions Variables Typedefs Macros
Public Types | Static Public Member Functions | List of all members
fun::Event Class Reference

Singleton class to access the Funapi's event subsystem.

#include <event.h>

Public Types

typedef function< void(const
string &, const EventId
&, const EventTag &, const Ptr
< Session > &)> 

Static Public Member Functions

static void Abort ()
 Aborts current event and nullify effects. More...
static bool Invoke (const function< void()> &func)
 Executes a function as an event.
static bool Invoke (const function< void()> &func, const EventTag &event_tag)
template<typename EventT >
static bool Post (Ptr< EventT > event)
 Posts an event so that listeners for the event can handle it.
template<typename EventT >
static bool Post (Ptr< EventT > event, const EventTag &event_tag)
template<typename EventT >
static void RegisterHandler (const function< ChainAction(Ptr< const EventT >)> &h)
 Listens to a particular event type. More...
template<typename EventT >
static void RegisterHandler (ChainAction(handler)(Ptr< const EventT >))
 Registers a handler for a particular event type.
static void RegisterTimeoutHandler (const TimeoutHandler &handler)
 Registers the event timeout handler.
static void Resume (const EventTag &event_tag)

Member Function Documentation

static void fun::Event::Abort ( )

Same as returning ChainAction::ABORT.

template<typename EventT >
static void fun::Event::RegisterHandler ( const function< ChainAction(Ptr< const EventT >)> &  h)

There could be multiple listeners for an event.