-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathordpair.cpp
More file actions
executable file
·107 lines (99 loc) · 2.33 KB
/
Copy pathordpair.cpp
File metadata and controls
executable file
·107 lines (99 loc) · 2.33 KB
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
103
104
105
106
#include "ordpair.h"
void Hash::Insert (OP Location,int Gap)
{
Junc_I=Junctions.find(Location);
if (Junc_I == Junctions.end()) //New entry..
{
(Junctions[Location]).Count=1;
(Junctions[Location]).Gap=Gap;
(Junctions[Location]).Junc_Type=INIT;
}
else
{
(Junc_I->second).Count++;//=Data;
(Junc_I->second).Gap=Gap;
}
}
void Hash::Insert (OP Location,int Paring,int Gap)
{
Junc_I=Junctions.find(Location);
if (Junc_I == Junctions.end()) //New entry..
{
(Junctions[Location]).Count=1;
(Junctions[Location]).Gap=Gap;
(Junctions[Location]).Junc_Type=Paring;
}
else
{
(Junc_I->second).Count++;//=Data;
(Junc_I->second).Gap=Gap;
(Junc_I->second).Junc_Type=Paring;
}
}
void Hash::Insert_Ref (OP Location,int Paring,int Gap)
{
Junc_I=Junctions.find(Location);
if (Junc_I == Junctions.end()) //New entry..
{
(Junctions[Location]).Count=REFMARK;
(Junctions[Location]).Gap=Gap;
(Junctions[Location]).Junc_Type=Paring;
}
else
{
(Junc_I->second).Count++;//=Data;
(Junc_I->second).Gap=Gap;
(Junc_I->second).Junc_Type=Paring;
}
}
void Hash::Delete (OP Location)
{
Junc_I=Junctions.find(Location);
if (Junc_I != Junctions.end()) Junctions.erase(Junc_I);
}
bool Hash::Init_Iterate(OP & Location,JStat & Data)
{
Junc_I=Junctions.begin();
if (Junc_I == Junctions.end()) return false;
else
{
Last=Junc_I;//save last pos...
Location = Junc_I->first;
Data = Junc_I->second;
Junc_I++;
return true;
}
}
bool Hash::Iterate(OP & Location,JStat & Data)
{
if(Junc_I == Junctions.end()) return false;
Last=Junc_I;//save last pos...
Location = Junc_I->first;
Data = Junc_I->second;
Junc_I++;
return true;
}
bool Hash::Init_IterateX(OP & Location,JStat & Data)
{
Junc_I=Junctions.begin();
while(!((Junc_I->second).Junc_Type)) if (Junc_I == Junctions.end()) break; else Junc_I++;//skip deleted / no juction cases..
if (Junc_I == Junctions.end()) return false;
else
{
Last=Junc_I;//save last pos...
Location = Junc_I->first;
Data = Junc_I->second;
Junc_I++;
return true;
}
}
bool Hash::IterateX(OP & Location,JStat & Data)
{
if(Junc_I == Junctions.end()) return false;
while(!((Junc_I->second).Junc_Type)) if (Junc_I == Junctions.end()) return false; else Junc_I++;//skip deleted / no juction cases..
Last=Junc_I;//save last pos...
Location = Junc_I->first;
Data = Junc_I->second;
Junc_I++;
return true;
}