77 lines
1.9 KiB
C++
77 lines
1.9 KiB
C++
/*
|
|
* File: NDMessage.cc
|
|
* Author: Grit Schneider
|
|
*
|
|
* Created on August 16, 2012, 10:37 AM
|
|
*/
|
|
|
|
#include "NDMessage.h"
|
|
|
|
#include "Dispatcher.h"
|
|
#include "common/validator/MessageValidator.h"
|
|
#include "fd/NetworkFailureDetector.h"
|
|
|
|
namespace ubeeme {
|
|
namespace moversight {
|
|
/**
|
|
* @brief Constructor
|
|
*/
|
|
NDMessage::NDMessage() : MoversightMessage("ND", ND) {
|
|
}
|
|
|
|
/**
|
|
* @brief Destructor.
|
|
*/
|
|
NDMessage::~NDMessage() {
|
|
}
|
|
|
|
/**
|
|
* @brief Copy constructor
|
|
* @param other
|
|
*/
|
|
NDMessage::NDMessage(const NDMessage & other) : MoversightMessage(other) {
|
|
operator =(other);
|
|
}
|
|
|
|
/**
|
|
* @brief Creates a copy of the current message.
|
|
* @return The copy of the current message.
|
|
*/
|
|
NDMessage *
|
|
NDMessage::dup() const {
|
|
return new NDMessage(*this);
|
|
}
|
|
|
|
/**
|
|
* @brief Assignment operator.
|
|
* @param other The instance to assign.
|
|
* @return A reference to the local instance.
|
|
*/
|
|
NDMessage &
|
|
NDMessage::operator=(const NDMessage & 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
|
|
NDMessage::handleReceive(Dispatcher& dis) {
|
|
if( dis.getMessageValidator()->isValid( *this)) {
|
|
dis.getNetworkFailureDetector().handleMessage(this);
|
|
}//end if
|
|
}
|
|
|
|
/**
|
|
* @brief Archive method
|
|
* @param archive The archive to which the attributes are to add
|
|
*/
|
|
void
|
|
NDMessage::set(Archive & archive) {
|
|
MoversightMessage::set(archive);
|
|
}
|
|
}
|
|
}
|