Tidying
This commit is contained in:
@@ -354,8 +354,10 @@ namespace Bloom
|
|||||||
|
|
||||||
if (event.state == TargetControllerState::SUSPENDED) {
|
if (event.state == TargetControllerState::SUSPENDED) {
|
||||||
emit this->insightSignals->targetControllerSuspended();
|
emit this->insightSignals->targetControllerSuspended();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
} else if (event.state == TargetControllerState::ACTIVE) {
|
if (event.state == TargetControllerState::ACTIVE) {
|
||||||
auto* getTargetDescriptorTask = new GetTargetDescriptor();
|
auto* getTargetDescriptorTask = new GetTargetDescriptor();
|
||||||
|
|
||||||
QObject::connect(
|
QObject::connect(
|
||||||
|
|||||||
@@ -165,12 +165,15 @@ namespace Bloom::TargetController
|
|||||||
*/
|
*/
|
||||||
template<class CommandType>
|
template<class CommandType>
|
||||||
void registerCommandHandler(std::function<std::unique_ptr<Responses::Response>(CommandType&)> callback) {
|
void registerCommandHandler(std::function<std::unique_ptr<Responses::Response>(CommandType&)> callback) {
|
||||||
auto parentCallback = [callback] (Commands::Command& command) {
|
this->commandHandlersByCommandType.insert(
|
||||||
|
std::pair(
|
||||||
|
CommandType::type,
|
||||||
|
[callback] (Commands::Command& command) {
|
||||||
// Downcast the command to the expected type
|
// Downcast the command to the expected type
|
||||||
return callback(dynamic_cast<CommandType&>(command));
|
return callback(dynamic_cast<CommandType&>(command));
|
||||||
};
|
}
|
||||||
|
)
|
||||||
this->commandHandlersByCommandType.insert(std::pair(CommandType::type, parentCallback));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user