Otclient  14/8/2020
Event Class Reference

#include <event.h>

Inheritance diagram for Event:
Collaboration diagram for Event:

Public Member Functions

 Event (const std::function< void()> &callback)
 
virtual ~Event ()
 
virtual void execute ()
 
void cancel ()
 
bool isCanceled ()
 
bool isExecuted ()
 
- Public Member Functions inherited from LuaObject
 LuaObject ()
 
virtual ~LuaObject ()
 
template<typename T >
void connectLuaField (const std::string &field, const std::function< T > &f, bool pushFront=false)
 
template<typename... T>
int luaCallLuaField (const std::string &field, const T &... args)
 
template<typename R , typename... T>
callLuaField (const std::string &field, const T &... args)
 
template<typename... T>
void callLuaField (const std::string &field, const T &... args)
 
bool hasLuaField (const std::string &field)
 Returns true if the lua field exists. More...
 
template<typename T >
void setLuaField (const std::string &key, const T &value)
 Sets a field in this lua object. More...
 
template<typename T >
getLuaField (const std::string &key)
 Gets a field from this lua object. More...
 
void releaseLuaFieldsTable ()
 Release fields table reference. More...
 
void luaSetField (const std::string &key)
 Sets a field from this lua object, the value must be on the stack. More...
 
void luaGetField (const std::string &key)
 Gets a field from this lua object, the result is pushed onto the stack. More...
 
void luaGetMetatable ()
 Get object's metatable. More...
 
void luaGetFieldsTable ()
 Gets the table containing all stored fields of this lua object, the result is pushed onto the stack. More...
 
int getUseCount ()
 
std::string getClassName ()
 Returns the derived class name, its the same name used in Lua. More...
 
LuaObjectPtr asLuaObject ()
 
void operator= (const LuaObject &)
 
- Public Member Functions inherited from stdext::shared_object
 shared_object ()
 
virtual ~shared_object ()
 
void add_ref ()
 
void dec_ref ()
 
refcount_t ref_count ()
 
template<typename T >
stdext::shared_object_ptr< T > static_self_cast ()
 
template<typename T >
stdext::shared_object_ptr< T > dynamic_self_cast ()
 
template<typename T >
stdext::shared_object_ptr< T > const_self_cast ()
 

Protected Attributes

std::function< void()> m_callback
 
bool m_canceled
 
bool m_executed
 

Detailed Description

Definition at line 29 of file event.h.

Constructor & Destructor Documentation

◆ Event()

Event::Event ( const std::function< void()> &  callback)

Definition at line 25 of file event.cpp.

◆ ~Event()

Event::~Event ( )
virtual

Definition at line 32 of file event.cpp.

Member Function Documentation

◆ cancel()

void Event::cancel ( )

Definition at line 49 of file event.cpp.

Here is the caller graph for this function:

◆ execute()

void Event::execute ( )
virtual

Reimplemented in ScheduledEvent.

Definition at line 38 of file event.cpp.

Here is the caller graph for this function:

◆ isCanceled()

bool Event::isCanceled ( )
inline

Definition at line 38 of file event.h.

Here is the caller graph for this function:

◆ isExecuted()

bool Event::isExecuted ( )
inline

Definition at line 39 of file event.h.

Here is the caller graph for this function:

Member Data Documentation

◆ m_callback

std::function<void()> Event::m_callback
protected

Definition at line 42 of file event.h.

◆ m_canceled

bool Event::m_canceled
protected

Definition at line 43 of file event.h.

◆ m_executed

bool Event::m_executed
protected

Definition at line 44 of file event.h.


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