#include <broker.hpp>
In order to make a class brokerable, simply use the BROKER_DECLARE_CREATOR() and BROKER_DEFINE_CREATOR() macros. These will create the global broker if necessary, and automatically register the class as creatable. The broker will delete itself when its last creator goes out of scope.
Definition at line 85 of file broker.hpp.
Public Member Functions | |
brokered_object * | create_object (const gsgl::string &type_name, const config_record &conf) |
bool | has_object (const gsgl::string &type_name) |
void | register_resource (R *) |
void | unregister_resource (R *) |
Static Public Member Functions | |
static broker * | global_instance () |
Reimplemented in order to auto-create. | |
Protected Attributes | |
L | registered_resources |
Private Member Functions | |
broker () | |
virtual | ~broker () |
broker | ( | ) | [private] |
Definition at line 69 of file broker.cpp.
References gsgl::log().
Referenced by broker::global_instance().
~broker | ( | ) | [private, virtual] |
brokered_object * create_object | ( | const gsgl::string & | type_name, | |
const config_record & | conf | |||
) |
Definition at line 88 of file broker.cpp.
References assert, broker_creator::get_create_func(), gsgl::log(), global_register::registered_resources, brokered_object::type_name, and string::w_string().
Referenced by application::load_objects(), simulation::simulation(), and vehicle::vehicle().
broker * global_instance | ( | ) | [static] |
Reimplemented in order to auto-create.
Reimplemented from global_register.
Definition at line 110 of file broker.cpp.
References broker::broker().
Referenced by broker_creator::broker_creator(), application::load_objects(), simulation::simulation(), vehicle::vehicle(), and broker_creator::~broker_creator().
bool has_object | ( | const gsgl::string & | type_name | ) |
Definition at line 82 of file broker.cpp.
References global_register::registered_resources.
Referenced by application::load_objects().
void register_resource | ( | R * | r | ) | [inline, inherited] |
Definition at line 83 of file global.hpp.
References global_register::registered_resources.
Referenced by broker_creator::broker_creator(), and log_target::log_target().
void unregister_resource | ( | R * | r | ) | [inline, inherited] |
Definition at line 99 of file global.hpp.
References global_register::registered_resources.
Referenced by broker_creator::~broker_creator(), and log_target::~log_target().
L registered_resources [protected, inherited] |
Definition at line 55 of file global.hpp.
Referenced by broker::create_object(), broker::has_object(), logger::print_line(), global_register::register_resource(), and global_register::unregister_resource().