Samchon Framework for CPP  1.0.0
samchon::library::Event Class Reference

Represent an event running on background. More...

#include <Event.hpp>

Collaboration diagram for samchon::library::Event:

Public Member Functions

 Event (EventDispatcher *source, int type)
 Construct from source and type. More...
 
auto getSource () const -> EventDispatcher *
 Get source of the Event. More...
 
auto getType () const -> int
 Get type of the Event. More...
 

Protected Attributes

EventDispatchersource
 Source of the event. More...
 
int type
 Type of the event. More...
 

Detailed Description

Represent an event running on background.

The Event class is used as the base class for the creation of Event objects, which are passed as parameters to event listeners when an event occurs.

The properties of the Event class carry basic information about an event, such as the event's type or source (who made the event) of the event.

For many events, such as the events represented by the Event class constants, this basic information is sufficient. Other events, however, may require more detailed information.

library_event.png
Example Source
Deprecated:

Event is a candidate to be deprecated.

Since C++11, calling member method of a class by a new thread passing by static method and using void pointer are recommeded to avoid. As the reason, using std::thread and std::bind will be better.

See also
samchon::library
Author
Jeongho Nam http://samchon.org

Definition at line 41 of file Event.hpp.

Constructor & Destructor Documentation

samchon::library::Event::Event ( EventDispatcher source,
int  type 
)
inline

Construct from source and type.

The event object owns its source and type

Parameters
sourceSource of the event; who made the event
typeType of the event

Definition at line 70 of file Event.hpp.

References source, and type.

Member Function Documentation

auto samchon::library::Event::getSource ( ) const -> EventDispatcher*
inline

Get source of the Event.

Definition at line 80 of file Event.hpp.

References source.

auto samchon::library::Event::getType ( ) const -> int
inline

Get type of the Event.

Definition at line 88 of file Event.hpp.

References type.

Member Data Documentation

EventDispatcher* samchon::library::Event::source
protected

Source of the event.

Definition at line 55 of file Event.hpp.

Referenced by Event(), and getSource().

int samchon::library::Event::type
protected

Type of the event.

Definition at line 60 of file Event.hpp.

Referenced by Event(), and getType().


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