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

Event representing an error. More...

#include <ErrorEvent.hpp>

Collaboration diagram for samchon::library::ErrorEvent:

Public Member Functions

 ErrorEvent (EventDispatcher *source, const std::string &message)
 Construct from source and error-id. More...
auto getMessage () const -> std::string
 Get error-id. More...
- Public Member Functions inherited from samchon::library::Event
 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

std::string message
 Error message. More...
- Protected Attributes inherited from samchon::library::Event
 Source of the event. More...
int type
 Type of the event. More...

Detailed Description

Event representing an error.


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.

Example Source

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
Jeongho Nam

Definition at line 18 of file ErrorEvent.hpp.

Constructor & Destructor Documentation

samchon::library::ErrorEvent::ErrorEvent ( EventDispatcher source,
const std::string &  message 

Construct from source and error-id.

The event object owns its source and type

sourceSource of the event; who made the event
idAn error-id

Definition at line 50 of file ErrorEvent.hpp.

References message.

Member Function Documentation

auto samchon::library::ErrorEvent::getMessage ( ) const -> std::string

Get error-id.

Definition at line 60 of file ErrorEvent.hpp.

References message.

Member Data Documentation

std::string samchon::library::ErrorEvent::message

Error message.

Definition at line 35 of file ErrorEvent.hpp.

Referenced by ErrorEvent(), and getMessage().

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