64 lines
1.7 KiB
C++
64 lines
1.7 KiB
C++
/*
|
|
* File: MoversightSimulationPeerStateVisualization.h
|
|
* Author: jgaebler
|
|
*
|
|
* Created on November 1, 2012, 4:29 PM
|
|
*/
|
|
#pragma once
|
|
|
|
#ifndef MOVERSIGHTSIMULATIONPEERSTATEVISUALIZATION_H
|
|
#define MOVERSIGHTSIMULATIONPEERSTATEVISUALIZATION_H
|
|
|
|
#include <cmodule.h>
|
|
#include <cdisplaystring.h>
|
|
#include "common/MoversightService.h"
|
|
|
|
namespace ubeeme {
|
|
namespace moversight {
|
|
|
|
class GroupCreatedEvent;
|
|
class PeerJoinedEvent;
|
|
class Dispatcher;
|
|
|
|
/**
|
|
* @class MoversightSimulationPeerStateVisualization
|
|
* @author Jan Gäbler
|
|
* @brief This class provides an visualization service for the moversight peer state in Omnetpp.
|
|
* @ingroup Moversight
|
|
*/
|
|
class MoversightSimulationPeerStateVisualization : public MoversightService {
|
|
public:
|
|
|
|
MoversightSimulationPeerStateVisualization(Dispatcher & dis);
|
|
virtual ~MoversightSimulationPeerStateVisualization();
|
|
|
|
virtual void initialise();
|
|
virtual void finalise();
|
|
|
|
virtual void updateSimUI();
|
|
|
|
virtual void handleEvent(const MoversightEvent& e);
|
|
virtual void handleEvent(const ConnectionLostEvent& e);
|
|
virtual void handleEvent(const ConnectionReEstablishedEvent& e);
|
|
|
|
virtual void handleEvent(const PeerJoinedEvent& e);
|
|
virtual void handleEvent(const PeerLeftEvent& e);
|
|
virtual void handleEvent(const PeerReconnectedEvent& e);
|
|
virtual void handleEvent(const PendingPeersEvent& e);
|
|
|
|
private:
|
|
|
|
void updateRole();
|
|
void updateState();
|
|
|
|
cDisplayString & getMoversightDisplayString();
|
|
};
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
#endif /* MOVERSIGHTSIMULATIONPEERSTATEVISUALIZATION_H */
|
|
|