72 lines
1.6 KiB
C++
72 lines
1.6 KiB
C++
/*
|
|
* File: MergeApplication.h
|
|
* Author: sgaebler
|
|
*
|
|
* Created on July 8, 2011, 03:37 PM
|
|
*/
|
|
|
|
#ifndef MERGEAPPLICATION_H
|
|
#define MERGEAPPLICATION_H
|
|
|
|
#include "Application.h"
|
|
|
|
#include "common/Defines.h"
|
|
#include "ms/PeerState.h"
|
|
|
|
namespace ubeeme {
|
|
namespace moversight {
|
|
|
|
class Dispatcher;
|
|
class Moversight;
|
|
class Invitation;
|
|
|
|
class MergeApplication : public Application {
|
|
public:
|
|
|
|
MergeApplication(Moversight & m);
|
|
virtual ~MergeApplication();
|
|
|
|
virtual void initialise();
|
|
|
|
void startTestCase(unsigned int i);
|
|
|
|
void receiveGroupData(const GroupData & data, const PeerID sender);
|
|
|
|
// Event handling
|
|
virtual void handleEvent(const MergeRequestEvent & e);
|
|
virtual void handleEvent(const MergeDoneEvent & e);
|
|
|
|
private:
|
|
|
|
void testCase00();
|
|
void testCase01();
|
|
void testCase02();
|
|
|
|
void invitePeer(TransportAddress & ta);
|
|
void leaveGroup();
|
|
void sendData();
|
|
void mergeRequest(TransportAddress & ta);
|
|
void mergeGroup();
|
|
void createRoster(int rosterNumber);
|
|
void createRoster2();
|
|
TransportAddress getNewTransportAddress(int i);
|
|
|
|
State state;
|
|
|
|
bool mergeOnce;
|
|
|
|
int waitCounter;
|
|
|
|
int mergeCase;
|
|
|
|
cOutVector mergeDuration;
|
|
simtime_t dt;
|
|
int numberOfPeers;
|
|
int clusterSize;
|
|
|
|
};
|
|
}
|
|
}
|
|
#endif /* MERGEAPPLICATION_H */
|
|
|