iFun Engine API  1.0.0-b6053
Great Technology for Great Games
Classes | 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>

Classes

struct  EventTypeCaster
 

Public Types

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

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)
 
static bool Invoke (const function< void()> &func, const string &event_name)
 
static bool Invoke (const function< void()> &func, const string &event_name, 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 bool Post (Ptr< EventT > event, const string &event_name)
 
template<typename EventT >
static bool Post (Ptr< EventT > event, const string &event_name, 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

◆ Abort()

static void fun::Event::Abort ( )
static

Same as returning ChainAction::ABORT.

◆ RegisterHandler()

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

There could be multiple listeners for an event.