OverSim
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
DiscoveryMode.h
Go to the documentation of this file.
1
/*
2
* DiscoveryMode.h
3
*
4
* Created on: Sep 27, 2010
5
* Author: heep
6
*/
7
8
#ifndef DISCOVERYMODE_H_
9
#define DISCOVERYMODE_H_
10
11
#include <
RpcListener.h
>
12
#include <
NeighborCache.h
>
13
#include <
DiscoveryMode_m.h
>
14
15
class
BasePastry
;
16
17
class
DiscoveryMode
:
public
RpcListener
,
ProxListener
18
{
19
private
:
20
NeighborCache
*
neighborCache
;
21
22
uint8_t
numCloseNodes
;
23
uint8_t
numSpreadedNodes
;
24
25
double
firstRtt
;
26
double
improvement
;
27
28
bool
finished
;
29
30
BasePastry
*
basePastry
;
31
32
protected
:
33
int16_t
step
;
34
uint8_t
maxSteps
;
35
int8_t
spreadedSteps
;
36
uint8_t
queries
;
37
int8_t
maxIndex
;
38
simtime_t
nearNodeRtt
;
39
bool
nearNodeImproved
;
40
TransportAddress
nearNode
;
41
42
void
proxCallback
(
const
TransportAddress
& node,
int
rpcId,
43
cPolymorphic *contextPointer,
Prox
prox);
44
45
void
sendNewRequest
(
DiscoveryNodesType
type, uint8_t numNodes);
46
47
public
:
48
virtual
~DiscoveryMode
() {};
49
50
void
init
(
NeighborCache
*
neighborCache
);
51
void
start
(
const
TransportAddress
& bootstrapNode);
52
void
stop
();
53
54
double
getImprovement
() {
return
improvement
; };
55
bool
isFinished
() {
return
finished
; };
56
57
bool
handleRpcCall
(
BaseCallMessage
* msg);
58
59
void
handleRpcResponse
(
BaseResponseMessage
* msg,
60
cPolymorphic* context,
61
int
rpcId, simtime_t rtt);
62
63
void
handleRpcTimeout
(
BaseCallMessage
* msg,
64
const
TransportAddress
& dest,
65
cPolymorphic* context,
int
rpcId,
66
const
OverlayKey
& destKey);
67
};
68
69
#endif
/* DISCOVERYMODE_H_ */
src
common
DiscoveryMode.h
Generated on Fri Dec 7 2012 13:37:52 for OverSim by
1.8.1.2