14 #ifndef EVENTHANDLER_H
15 #define EVENTHANDLER_H
40 typedef void EventFunction(
const Event *);
41 typedef void EventCallbackFunction(
const Event *,
void *);
47 AsyncFuture *get_future(
const std::string &event_name);
49 void process_events();
51 virtual void dispatch_event(
const Event *event);
53 void write(std::ostream &out)
const;
58 bool add_hook(
const std::string &event_name, EventFunction *
function);
59 bool add_hook(
const std::string &event_name, EventCallbackFunction *
function,
61 bool has_hook(
const std::string &event_name)
const;
62 bool has_hook(
const std::string &event_name, EventFunction *
function)
const;
63 bool has_hook(
const std::string &event_name, EventCallbackFunction *
function,
65 bool remove_hook(
const std::string &event_name, EventFunction *
function);
66 bool remove_hook(
const std::string &event_name, EventCallbackFunction *
function,
69 bool remove_hooks(
const std::string &event_name);
70 bool remove_hooks_with(
void *data);
72 void remove_all_hooks();
78 typedef std::pair<EventCallbackFunction*, void*> CallbackFunction;
89 static void make_global_event_handler();
92 void write_hook(std::ostream &out,
const Hooks::value_type &hook)
const;
93 void write_cbhook(std::ostream &out,
const CallbackHooks::value_type &hook)
const;
103 TypedObject::get_class_type());
106 return get_class_type();