Files
2014-06-30 13:58:10 +02:00

59 lines
1.9 KiB
C++

/*
* File: StandardValidator.cc
* Author: jgaebler
*
* Created on May 12, 2011, 4:24 PM
*/
#include "StandardValidator.h"
namespace ubeeme {
namespace moversight {
/**
* @brief Constructor
* @param dis A reference to the moversight dispatcher.
*/
StandardValidator::StandardValidator( Dispatcher& dis)
: MessageValidator( dis) {
}
/**
* @brief Destructor
*/
StandardValidator::~StandardValidator(){
}
/**
* @brief Checks, if the received interior message valid within the current group.
* @param msg The message to validate.
* @return True, if the received message checked as valid message within the current group, false otherwise.
*/
bool
StandardValidator::isValid( const MoversightMessage& msg) const {
return membershipService.contains( msg.getSourceID());
}
/**
* @brief Checks, if the received multicast message valid within the current view, or not (in terms of relates to the current group setting).
* @param msg The message to validate.
* @return True, if the received message checked as valid message within the current view, false otherwise.
*/
bool
StandardValidator::isValid( const MulticastMessage& msg) const {
return membershipService.contains( msg.getSourceID()) && msg.getViewID() == membershipService.getViewID();
}
/**
* @brief Checks, if the received exterior message valid within the current view, or not.
* @param msg The message to validate.
* @return True, if the received message checked as valid message within the current view, false otherwise.
*/
bool
StandardValidator::isValid( const ExteriorMessage& msg) const {
return true;
}
}
}