/* * File: ReferenceMonitorTimer.h * Author: jgaebler * * Created on February 18, 2013, 10:09 AM */ #pragma once #ifndef REFERENCEMONITORTIMER_H #define REFERENCEMONITORTIMER_H #include "ReferenceTimer.h" #include "common/container/PeerIDList.h" namespace ubeeme { namespace moversight { /** * @class ReferenceMonitorTimer * @author Jan Gäbler * @brief Defines a reference timer that monitors a list of peers. * @ingroup Moversight */ template class ReferenceMonitorTimer : public ReferenceTimer { public: ReferenceMonitorTimer(MoversightService & aService); ReferenceMonitorTimer(const ReferenceMonitorTimer& orig); virtual ~ReferenceMonitorTimer(); virtual void timeout() = 0; ReferenceMonitorTimer & operator=(const ReferenceMonitorTimer & other); virtual void setPeerIDList(PeerIDList peerList); virtual PeerIDList getPeerIDList(); }; /** * @brief Constructor * @param service The service that owns that timer. */ template ReferenceMonitorTimer::ReferenceMonitorTimer(MoversightService & aService) : ReferenceTimer(aService) { } /** * @brief Copy constructor * @param orig The instance to copy */ template ReferenceMonitorTimer::ReferenceMonitorTimer(const ReferenceMonitorTimer & orig) : ReferenceTimer(orig) { operator=(orig); } /** * @brief Destructor */ template ReferenceMonitorTimer::~ReferenceMonitorTimer() { } /** * @brief Sets the peer ids to monitor * @param peerList The peer ids to monitor */ template void ReferenceMonitorTimer::setPeerIDList(PeerIDList peerList) { MoversightTimer::storage.set("peerIDList", peerList); } /** * @brief Returns the peer ids to monitor * @return The peer ids to monitor. */ template PeerIDList ReferenceMonitorTimer::getPeerIDList() { return MoversightTimer::storage.get("peerIDList"); } /** * @brief Assignment operator * @param other The instance to copy * @return A reference to the local instance. */ template ReferenceMonitorTimer & ReferenceMonitorTimer::operator=(const ReferenceMonitorTimer & other) { if (this != &other) { ReferenceTimer::operator =(other); }//End if return *this; } } } #endif /* REFERENCEMONITORTIMER_H */