GUI
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
gui::EventListener Class Reference

Wrapper for std::function; used by EventEmitter to append IDs to listening functions. More...

#include <EventListener.h>

Public Types

typedef std::function< void(Event &)> Function
 
typedef unsigned int Id
 

Public Member Functions

 EventListener ()
 
 EventListener (Function function)
 
void bind (Function &function)
 
void operator() (Event &event)
 

Private Attributes

Function func
 
EventListener::Id id
 

Friends

class EventEmitter
 
class GUISystem
 

Detailed Description

Wrapper for std::function; used by EventEmitter to append IDs to listening functions.

Definition at line 17 of file EventListener.h.

Member Typedef Documentation

◆ Function

typedef std::function<void(Event&)> gui::EventListener::Function

Definition at line 20 of file EventListener.h.

◆ Id

typedef unsigned int gui::EventListener::Id

Definition at line 21 of file EventListener.h.

Constructor & Destructor Documentation

◆ EventListener() [1/2]

gui::EventListener::EventListener ( )
inline

Definition at line 23 of file EventListener.h.

References bind(), and operator()().

◆ EventListener() [2/2]

EventListener::EventListener ( Function  function)

Definition at line 9 of file EventListener.cpp.

References bind().

Member Function Documentation

◆ bind()

void EventListener::bind ( Function function)

Definition at line 14 of file EventListener.cpp.

References func.

◆ operator()()

void EventListener::operator() ( Event event)

Definition at line 19 of file EventListener.cpp.

References func.

Friends And Related Function Documentation

◆ EventEmitter

friend class EventEmitter
friend

Definition at line 35 of file EventListener.h.

◆ GUISystem

friend class GUISystem
friend

Definition at line 36 of file EventListener.h.

Member Data Documentation

◆ func

Function gui::EventListener::func
private

Definition at line 32 of file EventListener.h.

◆ id

EventListener::Id gui::EventListener::id
private

Definition at line 33 of file EventListener.h.


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