Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::view::CommandHandler Class Referenceabstract

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.

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~CommandHandler()

virtual pulp::view::CommandHandler::~CommandHandler ( )
virtualdefault

Member Function Documentation

◆ commands()

virtual std::vector< CommandID > pulp::view::CommandHandler::commands ( ) const
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.

◆ perform_command()

virtual bool pulp::view::CommandHandler::perform_command ( CommandID id)
pure virtual

Perform a command.

Return true if handled (stops the dispatch walk), false to let the next handler in the chain try.


The documentation for this class was generated from the following file: