/* * File: AwaitRejoinTimer.cc * Author: gschneid * Author: jgaebler * * Created on October 2, 2012, 8:53 AM */ #include "AwaitRejoinTimer.h" #include "Moversight.h" #include "Dispatcher.h" #include "mob/MobilitySupport.h" namespace ubeeme { namespace moversight { #undef DEBUG #define DEBUG(msg) if ( nd.module.isPrintDebugNFD()) MOV_DEBUG << "ART@" << mob.dispatcher.getLocalID() << " "<(aMob) { #if OMNETPP setName("AR_TIMER"); #endif setNumberOfRetries(PD_NUMBER_OF_MAX_RETRIES); setTimeout(AR_TIMEOUT); } /** * @brief Copy constructor. * @param other The instance to copy. */ AwaitRejoinTimer::AwaitRejoinTimer(const AwaitRejoinTimer& other) : ReferenceTimer(other.service) { #if OMNETPP setName(other.getName()); #endif operator=(other); } /** * @brief Destructor */ AwaitRejoinTimer::~AwaitRejoinTimer() { } /** * @brief Assignment operator * @param other The instance to copy * @return A reference to the local instance. */ AwaitRejoinTimer & AwaitRejoinTimer::operator=(const AwaitRejoinTimer & other) { if (this != &other) { ReferenceTimer::operator =(other); }//End if return *this; } /** * @brief If the timer is fired, this method is called and the timer * handled. */ void AwaitRejoinTimer::timeout() { dynamic_cast (service).handleAwaitRejoinTimer(this); } /** * @brief A duplicate method. Duplicates the current timer. * @return A reference to the new created timer. */ AwaitRejoinTimer* AwaitRejoinTimer::dup() { return new AwaitRejoinTimer(*this); } /** * @brief Sets if this peer has started the rejoin. * @param pStarter - true if yes, false otherwise */ void AwaitRejoinTimer::setStartedRejoin(bool pStarter) { storage.set("starter", pStarter); } /** * @brief Has this peer started the rejoin. * @return true if yes, false otherwise */ bool AwaitRejoinTimer::startedRejoin() { return storage.get("starter"); } }; };