-
Notifications
You must be signed in to change notification settings - Fork 7
/
Path.cpp
executable file
·53 lines (46 loc) · 1.22 KB
/
Path.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Path.cpp: implementation of the CPath class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "MANET.h"
#include "Path.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CPath::CPath(CString firsthop,unsigned ticknum,unsigned hopnum,unsigned size,unsigned seqnum)
{
///////////////////////////////////
FirstHop =firsthop;
TickNum =ticknum;
HopNum =hopnum;
//Size =size;
///////////////////////////////////
SizeCount =size;
SeqNum =seqnum;
///////////////////////////////////
}
CPath::~CPath()
{
}
BOOL CPath::Update(CPacket *packet)
{
if( //(FirstHop!=packet->Uploader)|| (HopNum!=packet->HopCount) ||
//(Size!=packet->SizeCount) || (TickNum=packet->TickCount) ||
(SeqNum<packet->SeqNum))
{
FirstHop=packet->Uploader;
HopNum=packet->HopCount;
SizeCount=packet->SizeCount;
TickNum=packet->TickCount;
//SizeCount=Size;
SeqNum=packet->SeqNum;
return 1;
}
else
return 0;
}