Files
scandocs/uni/masterarbeit/source/moversight/ms/timer/LeaveAnnounceTimer.cc
2014-06-30 13:58:10 +02:00

57 lines
1.3 KiB
C++

/*
* File: LeaveAnnounceTimer.cc
* Author: jgaebler
*
* Created on January 17, 2013, 4:51 PM
*/
#include "LeaveAnnounceTimer.h"
#include "MembershipService.h"
namespace ubeeme {
namespace moversight {
/**
* @brief Constructor
* @param ms A reference to the membership service.
*/
LeaveAnnounceTimer::LeaveAnnounceTimer(MembershipService & ms) : ReferenceMonitorTimer<VirtualLogicalTime>(ms) {
#if OMNETPP
setName("LeaveAnnounceTimer");
#endif
GenericTime t(LEAVE_ANNOUNCE_TIMEOUT);
setTimeout(t);
setNumberOfRetries(MS_NUMBER_OF_MAX_RETRIES);
}
/**
* @brief Destructor.
*/
LeaveAnnounceTimer::~LeaveAnnounceTimer() {
}
/**
* @brief Copy method. Creates a copy of the local timer instance.
* @return A copy of the current instance.
*/
LeaveAnnounceTimer *
LeaveAnnounceTimer::dup() {
return new LeaveAnnounceTimer(*this);
}
/**
* @brief If the timer is fired, this method is called and the timer
* handled.
*/
void
LeaveAnnounceTimer::timeout() {
dynamic_cast<MembershipService& >(service).handleLeaveAnnounceTimer(this);
}
}
}