update20140630
This commit is contained in:
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
* File: ReJoinRosterRequestTimer.cc
|
||||
* Author: jgaebler
|
||||
*
|
||||
* Created on 25. Februar 2012, 20:44
|
||||
*/
|
||||
|
||||
#include "ReJoinRosterRequestTimer.h"
|
||||
|
||||
#include "Moversight.h"
|
||||
#include "mob/MobilitySupport.h"
|
||||
|
||||
namespace ubeeme {
|
||||
namespace moversight {
|
||||
|
||||
/**
|
||||
* @brief Constructor
|
||||
* @param aMob A reference to the mobility support service.
|
||||
*/
|
||||
ReJoinRosterRequestTimer::ReJoinRosterRequestTimer(MoversightService & aMob) : MoversightTimer(aMob) {
|
||||
#if OMNETPP
|
||||
setName("ReJoinRosterRequestTimer");
|
||||
#endif
|
||||
setNumberOfRetries(MOB_NUMBER_OF_MAX_RETRIES);
|
||||
setTimeout(GenericTime(REJOIN_ROSTER_REQUEST_TIMEOUT));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Copy constructor
|
||||
* @param orig The instance to copy
|
||||
*/
|
||||
ReJoinRosterRequestTimer::ReJoinRosterRequestTimer(const ReJoinRosterRequestTimer & orig) : MoversightTimer(orig) {
|
||||
operator=(orig);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Destructor
|
||||
*/
|
||||
ReJoinRosterRequestTimer::~ReJoinRosterRequestTimer() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Assignment operator
|
||||
* @param other The instance to copy
|
||||
* @return A reference to the local instance.
|
||||
*/
|
||||
ReJoinRosterRequestTimer &
|
||||
ReJoinRosterRequestTimer::operator =(const ReJoinRosterRequestTimer& other) {
|
||||
|
||||
if (this != &other) {
|
||||
MoversightTimer::operator =(other);
|
||||
}//End if
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief If the timer is fired, this method is called and the timer
|
||||
* handled.
|
||||
*/
|
||||
void
|
||||
ReJoinRosterRequestTimer::timeout() {
|
||||
dynamic_cast<MobilitySupport&> (service).handleReJoinRosterRequestTimer(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Duplicates the current timer.
|
||||
* @return A copy of the current timer.
|
||||
*/
|
||||
ReJoinRosterRequestTimer *
|
||||
ReJoinRosterRequestTimer::dup() {
|
||||
return new ReJoinRosterRequestTimer(*this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets the list of IDs, used to address the peers for requesting
|
||||
* the rejoin roster.
|
||||
* @param list The list of the request IDs.
|
||||
*/
|
||||
void
|
||||
ReJoinRosterRequestTimer::setRequestList(const PeerIDList & list) {
|
||||
storage.set<PeerIDList>("requestList", list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns the stored request list, containing the IDs of the
|
||||
* peers to request potentially for the rejoin roster.
|
||||
* @return The request list, storing the ids of peers to request for the rejoin roster.
|
||||
*/
|
||||
PeerIDList
|
||||
ReJoinRosterRequestTimer::getRequestList() {
|
||||
return storage.get<PeerIDList>("requestList");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user