20 #ifndef INCLUDED_PLUGINS_CONTEXT_HPP_
21 #define INCLUDED_PLUGINS_CONTEXT_HPP_
35 typedef struct {
char const *
name; callback_function func; }
Reg;
38 typedef struct {
char const *
name; accessor_function func; }
aReg;
42 template<
int N,
int M>
50 for(
int i = 0;
i < N;
i++) {
51 l.push_back(callbacks[
i]);
53 for(
int i = 0;
i < M;
i++) {
54 r.push_back(accessors[
i]);
78 void initialize(
const std::vector<Reg>& callbacks,
const std::vector<aReg>& accessors);
86 extern const std::function< std::string ( const config & , const std::string & ) >
get_str;
87 extern const std::function< int ( const config & , const std::string &, int ) >
get_int;
88 extern const std::function< size_t ( const config & , const std::string &, size_t ) >
get_size_t;
void set_callback(const std::string &name, callback_function)
const std::function< std::string(const config &, const std::string &) > get_str
size_t erase_accessor(const std::string &name)
size_t erase_callback(const std::string &name)
const std::function< int(const config &, const std::string &, int) > get_int
void set_accessor_int(const std::string &name, std::function< int(config)>)
void initialize(const std::vector< Reg > &callbacks, const std::vector< aReg > &accessors)
plugins_context(const std::string &name, const Reg(&callbacks)[N], const aReg(&accessors)[M])
std::map< std::string, accessor_function > accessor_list
const std::function< size_t(const config &, const std::string &, size_t) > get_size_t
GLdouble GLdouble GLdouble r
std::function< config(config)> accessor_function
GLuint const GLchar * name
void set_accessor(const std::string &name, accessor_function)
plugins_context(const std::string &name)
std::map< std::string, callback_function > callback_list
A config object defines a single node in a WML file, with access to child nodes.
void set_accessor_string(const std::string &name, std::function< std::string(config)>)
GLsizei const GLcharARB ** string
std::function< bool(config)> callback_function