MessageQueue refactoring complete
This commit is contained in:
@ -65,29 +65,31 @@ void HealthHelper::informParent(HasHealthIF::HealthState health,
|
||||
if (parentQueue == 0) {
|
||||
return;
|
||||
}
|
||||
CommandMessage message;
|
||||
HealthMessage::setHealthMessage(&message, HealthMessage::HEALTH_INFO,
|
||||
MessageQueueMessage message;
|
||||
CommandMessage information(&message);
|
||||
HealthMessage::setHealthMessage(&information, HealthMessage::HEALTH_INFO,
|
||||
health, oldHealth);
|
||||
if (MessageQueueSenderIF::sendMessage(parentQueue, &message,
|
||||
if (MessageQueueSenderIF::sendMessage(parentQueue, &information,
|
||||
owner->getCommandQueue()) != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::debug << "HealthHelper::informParent: sending health reply failed."
|
||||
<< std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void HealthHelper::handleSetHealthCommand(CommandMessage* message) {
|
||||
ReturnValue_t result = owner->setHealth(HealthMessage::getHealth(message));
|
||||
if (message->getSender() == 0) {
|
||||
void HealthHelper::handleSetHealthCommand(CommandMessage* command) {
|
||||
ReturnValue_t result = owner->setHealth(HealthMessage::getHealth(command));
|
||||
if (command->getSender() == MessageQueueMessageIF::NO_QUEUE) {
|
||||
return;
|
||||
}
|
||||
CommandMessage reply;
|
||||
MessageQueueMessage message;
|
||||
CommandMessage reply(&message);
|
||||
if (result == HasReturnvaluesIF::RETURN_OK) {
|
||||
HealthMessage::setHealthMessage(&reply,
|
||||
HealthMessage::REPLY_HEALTH_SET);
|
||||
} else {
|
||||
reply.setReplyRejected(result, message->getCommand());
|
||||
reply.setReplyRejected(result, command->getCommand());
|
||||
}
|
||||
if (MessageQueueSenderIF::sendMessage(message->getSender(), &reply,
|
||||
if (MessageQueueSenderIF::sendMessage(command->getSender(), &reply,
|
||||
owner->getCommandQueue()) != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::debug << "HealthHelper::handleHealthCommand: sending health "
|
||||
"reply failed." << std::endl;
|
||||
|
Reference in New Issue
Block a user