update20140630
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* File: ControlMessage.cc
|
||||
* Author: jgaebler
|
||||
*
|
||||
* Created on February 9, 2011, 5:48 PM
|
||||
*/
|
||||
|
||||
#include "ControlMessage.h"
|
||||
|
||||
#include "Dispatcher.h"
|
||||
#include "common/validator/MessageValidator.h"
|
||||
#include "fd/NetworkFailureDetector.h"
|
||||
|
||||
namespace ubeeme {
|
||||
namespace moversight {
|
||||
|
||||
/**
|
||||
* @brief Constructor.
|
||||
*/
|
||||
ControlMessage::ControlMessage()
|
||||
: MoversightMessage("CM", CM) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Destructor.
|
||||
*/
|
||||
ControlMessage::~ControlMessage() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Copy constructor.
|
||||
* @param other Message to assign.
|
||||
*/
|
||||
ControlMessage::ControlMessage( const ControlMessage& other)
|
||||
: MoversightMessage( other) {
|
||||
operator=( other);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Creates a copy of the current message.
|
||||
* @return The copy of the current message.
|
||||
*/
|
||||
ControlMessage*
|
||||
ControlMessage::dup() const {
|
||||
return new ControlMessage( *this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Assignment operator.
|
||||
* @param other The instance to assign.
|
||||
* @return A reference to the local instance.
|
||||
*/
|
||||
ControlMessage&
|
||||
ControlMessage::operator=( const ControlMessage& other){
|
||||
MoversightMessage::operator=( other);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Handles this message. To handle a message, it has first successfully validated.
|
||||
* @param dis A reference to the dispatcher, used to forward this message to the handling modules.
|
||||
*/
|
||||
void
|
||||
ControlMessage::handleReceive( Dispatcher& dis) {
|
||||
if( dis.getMessageValidator()->isValid( *this)) {
|
||||
dis.getNetworkFailureDetector().handleMessage( this);
|
||||
}//end if
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user