EventEmitter< FuncType > Class Template Reference

Implements a simple event emitter class. More...

#include <EventEmitter.h>

Public Member Functions

void on (const std::string &event_name, FuncType func)
 
void on (const std::string &event_name, FuncType *func)
 
template<class ... Types>
void emit (const std::string &event_name, Types ... args)
 

Detailed Description

template<typename FuncType>
class EventEmitter< FuncType >

Implements a simple event emitter class.

This is C++11 only.

Example Usage:

EventEmitter<std::function<void(int)> emitter;

auto lam_auto = [] (int a) { std::cerr << a << std::endl; }; std::function<void(int)> lam = [] (int a) { std::cerr << a << std::endl; }; emitter.on("event0", lam); emitter.on("event0", lam_auto); emitter.on("event0", [] (int a) { std::cerr << a << std::endl; });

emitter.emit("event0");


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

Generated using doxygen 1.8.17