Reference | Class Hierarchy | Class Index | Member Index |
Public Member Functions | |
template<typename Handler> | |
void | dispatch (Handler handler) |
Request the dispatcher to invoke the given handler. | |
template<typename Handler> | |
void | post (Handler handler) |
Request the dispatcher to invoke the given handler and return immediately. | |
template<typename Handler> | |
unspecified | wrap (Handler handler) |
Create a new handler that automatically dispatches the wrapped handler on the dispatcher. |
void Dispatcher::dispatch | ( | Handler | handler | ) |
Request the dispatcher to invoke the given handler.
This function is used to ask the dispatcher to execute the given handler.
handler | The handler to be called. The dispatcher will make a copy of the handler object as required. The equivalent function signature of the handler must be: void handler();
|
void Dispatcher::post | ( | Handler | handler | ) |
Request the dispatcher to invoke the given handler and return immediately.
This function is used to ask the dispatcher to execute the given handler, but without allowing the dispatcher to call the handler from inside this function.
handler | The handler to be called. The dispatcher will make a copy of the handler object as required. The equivalent function signature of the handler must be: void handler();
|
unspecified Dispatcher::wrap | ( | Handler | handler | ) |
Create a new handler that automatically dispatches the wrapped handler on the dispatcher.
This function is used to create a new handler function object that, when invoked, will automatically pass the wrapped handler to the dispatcher's dispatch function.
handler | The handler to be wrapped. The dispatcher will make a copy of the handler object as required. The equivalent function signature of the handler must be: void handler(A1 a1, ... An an);
|
R f(A1 a1, ... An an);
dispatcher.wrap(f);
void g(A1 a1, ... An an);
dispatcher.dispatch(boost::bind(f, a1, ... an));