-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathprpl-transferInfo.cpp
102 lines (89 loc) · 2.06 KB
/
prpl-transferInfo.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#include "prpl-transferInfo.h"
pRPL::TransferInfo::
TransferInfo()
:_fromPrcID(pRPL::ERROR_ID),
_toPrcID(pRPL::ERROR_ID),
_subspcGlbID(pRPL::ERROR_ID),
_tDataType(pRPL::SPACE_TRANSFDATA),
_cmplt(false) {}
pRPL::TransferInfo::
TransferInfo(int fromPrcID,
int toPrcID,
const string &lyrName,
int subspcGlbID,
pRPL::TransferDataType transfType)
:_fromPrcID(fromPrcID),
_toPrcID(toPrcID),
_lyrName(lyrName),
_subspcGlbID(subspcGlbID),
_tDataType(transfType),
_cmplt(false) {}
int pRPL::TransferInfo::
fromPrcID() const {
return _fromPrcID;
}
int pRPL::TransferInfo::
toPrcID() const {
return _toPrcID;
}
const string& pRPL::TransferInfo::
lyrName() const {
return _lyrName;
}
int pRPL::TransferInfo::
subspcGlbID() const {
return _subspcGlbID;
}
pRPL::TransferDataType pRPL::TransferInfo::
transfDataType() const {
return _tDataType;
}
bool pRPL::TransferInfo::
completed() const {
return _cmplt;
}
void pRPL::TransferInfo::
complete() {
_cmplt = true;
}
void pRPL::TransferInfo::
restart() {
_cmplt = false;
}
const pRPL::TransferInfo* pRPL::TransferInfoVect::
findInfo(const string &lyrName,
int subspcGlbID) const {
const TransferInfo *pInfo = NULL;
TransferInfoVect::const_iterator itrInfo = begin();
while(itrInfo != end()) {
if(itrInfo->lyrName() == lyrName &&
itrInfo->subspcGlbID() == subspcGlbID) {
pInfo = &(*itrInfo);
break;
}
itrInfo++;
}
return pInfo;
}
bool pRPL::TransferInfoVect::
checkBcastCellspace(int prcID,
const string &lyrName) const {
bool cmplt = true;
bool found = false;
for(int iInfo = 0; iInfo < size(); iInfo++) {
if(at(iInfo).fromPrcID() == prcID &&
at(iInfo).lyrName() == lyrName &&
at(iInfo).transfDataType() == pRPL::SPACE_TRANSFDATA &&
at(iInfo).subspcGlbID() == pRPL::ERROR_ID) {
found = true;
if(at(iInfo).completed() == false) {
cmplt = false;
break;
}
}
}
if(found == false) {
cmplt = false;
}
return cmplt;
}