Added member function to deregister TargetController command handlers

This commit is contained in:
Nav
2022-04-18 18:49:49 +01:00
parent 0a21526a68
commit 5efffc6605
2 changed files with 6 additions and 0 deletions

View File

@@ -124,6 +124,10 @@ namespace Bloom::TargetController
return (response != nullptr) ? std::optional(std::move(response)) : std::nullopt; return (response != nullptr) ? std::optional(std::move(response)) : std::nullopt;
} }
void TargetControllerComponent::deregisterCommandHandler(Commands::CommandType commandType) {
this->commandHandlersByCommandType.erase(commandType);
}
void TargetControllerComponent::startup() { void TargetControllerComponent::startup() {
this->setName("TC"); this->setName("TC");
Logger::info("Starting TargetController"); Logger::info("Starting TargetController");

View File

@@ -132,6 +132,8 @@ namespace Bloom::TargetController
this->commandHandlersByCommandType.insert(std::pair(CommandType::type, parentCallback)); this->commandHandlersByCommandType.insert(std::pair(CommandType::type, parentCallback));
} }
void deregisterCommandHandler(Commands::CommandType commandType);
/** /**
* Updates the state of the TargetController and emits a state changed event. * Updates the state of the TargetController and emits a state changed event.
* *