Interface implemented by any object that can perform commands. More...
#include <command_registry.hpp>
Public Member Functions | |
| virtual | ~CommandHandler ()=default |
| virtual std::vector< CommandID > | commands () const =0 |
| Report which commands this handler can perform. | |
| virtual bool | perform_command (CommandID id)=0 |
| Perform a command. | |
Interface implemented by any object that can perform commands.
A handler is typically a View subclass but doesn't have to be — the registry holds raw CommandHandler* and the owner is responsible for removing the handler before destruction (see CommandRegistry::remove_handler). This mirrors how Pulp's other listener APIs (timer, async-update) work.
|
virtualdefault |
|
pure virtual |
Report which commands this handler can perform.
Called by the registry when dispatching; an empty result means "I don't know about that command — try the next handler". The default implementation returns the static commands() set, which makes per-instance overrides cheap.
|
pure virtual |
Perform a command.
Return true if handled (stops the dispatch walk), false to let the next handler in the chain try.