#include <context.hpp>
Classes | |
struct | aReg |
struct | Reg |
Public Types | |
typedef std::function< bool(config)> | callback_function |
typedef std::function< config(config)> | accessor_function |
using | reg_vec = std::vector< Reg > |
using | areg_vec = std::vector< aReg > |
Public Member Functions | |
plugins_context (const std::string &name) | |
plugins_context (const std::string &name, const reg_vec &callbacks, const areg_vec &accessors) | |
void | play_slice () |
void | set_callback (const std::string &name, callback_function) |
void | set_callback (const std::string &name, std::function< void(config)> function, bool preserves_context) |
std::size_t | erase_callback (const std::string &name) |
std::size_t | clear_callbacks () |
void | set_accessor (const std::string &name, accessor_function) |
void | set_accessor_string (const std::string &name, std::function< std::string(config)>) |
void | set_accessor_int (const std::string &name, std::function< int(config)>) |
std::size_t | erase_accessor (const std::string &name) |
std::size_t | clear_accessors () |
Private Types | |
typedef std::map< std::string, callback_function > | callback_list |
typedef std::map< std::string, accessor_function > | accessor_list |
Private Member Functions | |
void | initialize (const reg_vec &callbacks, const areg_vec &accessors) |
Private Attributes | |
callback_list | callbacks_ |
accessor_list | accessors_ |
std::string | name_ |
Friends | |
class | application_lua_kernel |
Definition at line 31 of file context.hpp.
typedef std::function<config(config)> plugins_context::accessor_function |
Definition at line 37 of file context.hpp.
|
private |
Definition at line 63 of file context.hpp.
using plugins_context::areg_vec = std::vector<aReg> |
Definition at line 41 of file context.hpp.
typedef std::function<bool(config)> plugins_context::callback_function |
Definition at line 34 of file context.hpp.
|
private |
Definition at line 62 of file context.hpp.
using plugins_context::reg_vec = std::vector<Reg> |
Definition at line 40 of file context.hpp.
plugins_context::plugins_context | ( | const std::string & | name | ) |
Definition at line 23 of file context.cpp.
plugins_context::plugins_context | ( | const std::string & | name, |
const reg_vec & | callbacks, | ||
const areg_vec & | accessors | ||
) |
Definition at line 29 of file context.cpp.
References initialize().
std::size_t plugins_context::clear_accessors | ( | ) |
Definition at line 89 of file context.cpp.
References accessors_.
std::size_t plugins_context::clear_callbacks | ( | ) |
Definition at line 61 of file context.cpp.
References callbacks_.
std::size_t plugins_context::erase_accessor | ( | const std::string & | name | ) |
Definition at line 84 of file context.cpp.
References accessors_.
std::size_t plugins_context::erase_callback | ( | const std::string & | name | ) |
Definition at line 56 of file context.cpp.
References callbacks_.
Definition at line 37 of file context.cpp.
References accessors_, and callbacks_.
Referenced by plugins_context().
void plugins_context::play_slice | ( | ) |
Definition at line 96 of file context.cpp.
References plugins_manager::get(), and plugins_manager::play_slice().
Referenced by do_gameloop(), game_launcher::init_lua_script(), and gui2::dialogs::modal_dialog::show().
void plugins_context::set_accessor | ( | const std::string & | name, |
accessor_function | func | ||
) |
Definition at line 68 of file context.cpp.
References accessors_.
Referenced by set_accessor_int(), and set_accessor_string().
void plugins_context::set_accessor_int | ( | const std::string & | name, |
std::function< int(config)> | func | ||
) |
Definition at line 78 of file context.cpp.
References set_accessor().
void plugins_context::set_accessor_string | ( | const std::string & | name, |
std::function< std::string(config)> | func | ||
) |
Definition at line 73 of file context.cpp.
References set_accessor().
void plugins_context::set_callback | ( | const std::string & | name, |
callback_function | func | ||
) |
Definition at line 51 of file context.cpp.
References callbacks_.
Referenced by do_gameloop(), set_callback(), and gui2::dialogs::modal_dialog::show().
void plugins_context::set_callback | ( | const std::string & | name, |
std::function< void(config)> | function, | ||
bool | preserves_context | ||
) |
Definition at line 102 of file context.cpp.
References set_callback().
|
friend |
Definition at line 59 of file context.hpp.
|
private |
Definition at line 68 of file context.hpp.
Referenced by clear_accessors(), erase_accessor(), initialize(), application_lua_kernel::thread::run_script(), and set_accessor().
|
private |
Definition at line 67 of file context.hpp.
Referenced by clear_callbacks(), erase_callback(), initialize(), application_lua_kernel::thread::run_script(), and set_callback().
|
private |
Definition at line 69 of file context.hpp.
Referenced by application_lua_kernel::thread::run_script().