$search
#include <context_watcher.h>
Public Member Functions | |
virtual void | lua_finalize (LuaContext *context)=0 |
virtual void | lua_init (LuaContext *context)=0 |
virtual void | lua_restarted (LuaContext *context)=0 |
virtual | ~LuaContextWatcher () |
Lua context watcher. This interface allows for notification of LuaContext events.
Definition at line 38 of file context_watcher.h.
fawkes::LuaContextWatcher::~LuaContextWatcher | ( | ) | [virtual] |
Virtual empty destructor.
Definition at line 73 of file context_watcher.cpp.
void fawkes::LuaContextWatcher::lua_finalize | ( | LuaContext * | context | ) | [pure virtual] |
Lua finalize event. This is called when the LuaContext is being restarted to finalize the old context. It is executed after the new context has been successfully initialized and can be used to perform any necessary finalization, e.g. closing network connections. Exceptions are ignored, so handle them in the finalizer.
context | This is a temporary LuaContext that is valid as long as the method is executed. It may be used only for the duration of the method call and may not be stored for later use. |
virtual void fawkes::LuaContextWatcher::lua_init | ( | LuaContext * | context | ) | [pure virtual] |
void fawkes::LuaContextWatcher::lua_restarted | ( | LuaContext * | context | ) | [pure virtual] |
Lua init event. This is called when the LuaContext is initialized. It is executed after all packages have been loaded and variables have been set, but before the start script is run. The implementation may throw an exception if anything prevents it from using the new context properly.
context | This is a temporary LuaContext that is valid as long as the method is executed. It is a wrapper context around the new Lua state, just before the start script is run and it the calling context is switched to the new state (if no error occurs). |
Lua restart event. This is called when the LuaContext has been restarted and the new state has been successfully initialized and start script has been run, the old state has been finalized, and the states have been swapped. You can use this hook to run commands on the fully initialized Lua state on a successful restart.
context | This is a temporary LuaContext that is valid as long as the method is executed. It may be used only for the duration of the method call and may not be stored for later use. |