OverSim
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
PubSubMMOG.h
Go to the documentation of this file.
1
//
2
// Copyright (C) 2006 Institut fuer Telematik, Universitaet Karlsruhe (TH)
3
//
4
// This program is free software; you can redistribute it and/or
5
// modify it under the terms of the GNU General Public License
6
// as published by the Free Software Foundation; either version 2
7
// of the License, or (at your option) any later version.
8
//
9
// This program is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with this program; if not, write to the Free Software
16
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
//
18
24
#ifndef __PUBSUBMMOG_H_
25
#define __PUBSUBMMOG_H_
26
27
#include <omnetpp.h>
28
#include <
NodeHandle.h
>
29
#include <
BaseOverlay.h
>
30
#include "
PubSubSubspace.h
"
31
#include "
PubSubMessage_m.h
"
32
33
class
PubSubMMOG
:
public
BaseOverlay
34
{
35
public
:
36
// OMNeT++
37
virtual
~PubSubMMOG
();
38
virtual
void
initializeOverlay
(
int
stage);
39
virtual
void
finishOverlay
();
40
virtual
void
handleUDPMessage
(
BaseOverlayMessage
* msg);
41
virtual
void
handleTimerEvent
(cMessage* msg);
42
virtual
void
handleAppMessage
(cMessage* msg);
43
virtual
void
receiveChangeNotification
(
int
category,
const
cPolymorphic *details);
44
virtual
bool
handleRpcCall
(
BaseCallMessage
* msg);
45
virtual
void
handleRpcResponse
(
BaseResponseMessage
*msg,
46
cPolymorphic* context,
47
int
rpcId, simtime_t rtt);
48
virtual
void
handleRpcTimeout
(
BaseCallMessage
*msg,
49
const
TransportAddress
& dest,
50
cPolymorphic* context,
51
int
rpcId,
const
OverlayKey
&destKey);
52
53
protected
:
54
55
void
setBootstrapedIcon
();
56
void
handleMove
(
GameAPIPositionMessage
* posMsg );
57
void
handleMoveMessage
(
PubSubMoveMessage
* moveMsg );
58
void
handleMoveListMessage
(
PubSubMoveListMessage
* moveMsg );
59
void
handleJoinResponse
(
PubSubJoinResponse
* joinResp );
60
void
handleSubscriptionCall
(
PubSubSubscriptionCall
* subCall );
61
void
handleSubscriptionResponse
(
PubSubSubscriptionResponse
* subResp );
62
void
handleResponsibleNodeResponse
(
PubSubResponsibleNodeResponse
* subResp );
63
void
handleTakeOver
(
PubSubTakeOverSubspaceCall
* toCall );
64
void
handleHelpResponse
(
PubSubHelpResponse
* helpResp );
65
void
handleBackupCall
(
PubSubBackupCall
* backupCall );
66
void
handleBackupResponse
(
PubSubBackupResponse
* backupResp );
67
void
handleIntermediateCall
(
PubSubIntermediateCall
* intermediateCall );
68
void
handleIntermediateResponse
(
PubSubIntermediateResponse
* intermediateResp );
69
void
handleAdoptChildCall
(
PubSubAdoptChildCall
* adoptCall );
70
void
handleAdoptChildResponse
(
PubSubAdoptChildResponse
* adoptResp );
71
void
handlePingCall
(
PubSubPingCall
* hearbeatCall );
72
void
handlePingResponse
(
PubSubPingResponse
* pingResp );
73
74
void
takeOverNewSubspace
(
PubSubSubspaceId
subspaceId );
75
void
takeOverSubspace
(
PubSubSubspaceResponsible
& subspaceId,
bool
isNew );
76
void
sendHearbeatToChildren
();
77
void
sendPingToChildren
();
78
void
handleParentTimeout
(
PubSubTimer
* timer );
79
void
handleBackupCallTimeout
(
PubSubBackupCall
* backupCall,
const
TransportAddress
& oldNode );
80
void
handlePingCallTimeout
(
PubSubPingCall
* pingCall,
const
TransportAddress
& oldNode );
81
void
handleSubscriptionCallTimeout
(
PubSubSubscriptionCall
* subscriptionCall,
const
TransportAddress
& oldNode );
82
void
handleUnsubscriptionMessage
(
PubSubUnsubscriptionMessage
* unsMsg );
83
void
handleNodeLeftMessage
(
PubSubNodeLeftMessage
* leftMsg );
84
void
handleReplacementMessage
(
PubSubReplacementMessage
* replaceMsg );
85
void
handleReleaseIntermediate
(
PubSubReleaseIntermediateMessage
* releaseMsg );
86
void
handleIntermediateBackup
(
PubSubBackupIntermediateMessage
* backupMsg );
87
void
handleSubscriptionBackup
(
PubSubBackupSubscriptionMessage
* backupMsg );
88
void
handleUnsubscribeBackup
(
PubSubBackupUnsubscribeMessage
* backupMsg );
89
90
void
unsubscribeChild
(
const
NodeHandle
& node,
PubSubSubspaceResponsible
& subspace );
91
void
sendMessageToChildren
(
PubSubSubspaceResponsible
& subspace,
92
BaseOverlayMessage
* toIntermediates,
93
BaseOverlayMessage
* toBackup,
94
BaseOverlayMessage
* toPlayers );
95
96
void
publishEvents
();
97
void
startTimer
(
PubSubTimer
* timer );
98
99
std::list<PubSubSubspace>
subscribedSubspaces
;
100
std::map<PubSubSubspaceId, PubSubSubspaceResponsible>
responsibleSubspaces
;
101
std::map<PubSubSubspaceId, PubSubSubspaceResponsible>
backupSubspaces
;
102
std::map<PubSubSubspaceId, PubSubSubspaceIntermediate>
intermediateSubspaces
;
103
104
int
subspaceSize
;
105
int
AOIWidth
;
106
107
int
numSubspaces
;
108
int
parentTimeout
;
109
int
maxChildren
;
110
111
bool
allowOldMoveMessages
;
112
113
unsigned
int
currentRegionX
,
currentRegionY
;
114
int
movementRate
;
115
int
maxMoveDelay
;
116
PubSubTimer
*
heartbeatTimer
;
117
PubSubTimer
*
childPingTimer
;
118
PubSubTimer
*
eventDeliveryTimer
;
119
cMessage*
joinTimer
;
120
TransportAddress
lobbyServer
;
121
122
// statistics
123
int
numEventsWrongTimeslot
;
124
int
numEventsCorrectTimeslot
;
125
int
numPubSubSignalingMessages
;
126
int
pubSubSignalingMessagesSize
;
127
int
numMoveMessages
;
128
int
moveMessagesSize
;
129
int
numMoveListMessages
;
130
int
moveListMessagesSize
;
131
int
respMoveListMessagesSize
;
132
int
lostMovementLists
;
133
int
receivedMovementLists
;
134
};
135
136
#endif
src
overlay
pubsubmmog
PubSubMMOG.h
Generated on Fri Dec 7 2012 13:37:53 for OverSim by
1.8.1.2