Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2010 ResiliNets, University of Kansas | 2 * Copyright (c) 2010 ResiliNets, University of Kansas |
3 * | 3 * |
4 * This program is free software; you can redistribute it and/or modify | 4 * This program is free software; you can redistribute it and/or modify |
5 * it under the terms of the GNU General Public License version 2 as | 5 * it under the terms of the GNU General Public License version 2 as |
6 * published by the Free Software Foundation; | 6 * published by the Free Software Foundation; |
7 * | 7 * |
8 * This program is distributed in the hope that it will be useful, | 8 * This program is distributed in the hope that it will be useful, |
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 * GNU General Public License for more details. | 11 * GNU General Public License for more details. |
12 * | 12 * |
13 * You should have received a copy of the GNU General Public License | 13 * You should have received a copy of the GNU General Public License |
14 * along with this program; if not, write to the Free Software | 14 * along with this program; if not, write to the Free Software |
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
16 * | 16 * |
17 * Authors: Hemanth Narra <hemanthnarra222@gmail.com> | 17 * Authors: Hemanth Narra <hemanthnarra222@gmail.com> |
18 * Kevin Peters <kevjay@gmail.com> | 18 * Kevin Peters <kevjay@gmail.com> |
19 * ResiliNets at The University of Kansas <https://wiki.ittc.ku.edu/resilinets/M ain_Page> | 19 * ResiliNets at The University of Kansas <https://wiki.ittc.ku.edu/resilinets/M ain_Page> |
20 * | |
21 * This header file is slightly modified by Amir Modarresi to declares and defin e | |
22 * internal state of a sift node | |
20 */ | 23 */ |
21 | 24 |
22 /// \brief» This header file declares and defines internal state of an AEROR P node. | 25 /// \brief» This header file declares and define the internal state of a sif t node. |
Tom Henderson
2015/12/08 01:12:03
not AERORP, but SIFT
Amir.Arc
2016/10/17 03:53:23
Done.
| |
23 | 26 |
24 #ifndef __SIFT_GEO_H__ | 27 #ifndef __SIFT_GEO_H__ |
25 #define __SIFT_GEO_H__ | 28 #define __SIFT_GEO_H__ |
26 | 29 |
27 #include "sift-repository.h" | |
28 #include "ns3/timer.h" | 30 #include "ns3/timer.h" |
29 #include <vector> | 31 #include <vector> |
30 #include <map> | 32 #include <map> |
33 | |
34 #include "sift-repository.h" | |
31 | 35 |
32 namespace ns3 { | 36 namespace ns3 { |
33 namespace sift { | 37 namespace sift { |
34 | 38 |
35 struct TimeFragments | 39 struct TimeFragments |
36 { | 40 { |
37 Time recordedTime; | 41 Time recordedTime; |
38 uint16_t fragmentNumber; | 42 uint16_t fragmentNumber; |
39 }; | 43 }; |
40 | 44 |
41 /// This class encapsulates all data structures needed for maintaining internal state of an AERORP node. | 45 /// This class encapsulates all data structures needed for maintaining internal state of a sift node. |
42 class SiftGeo | 46 class SiftGeo |
43 { | 47 { |
44 // friend class AeroRP; | 48 // friend class Sift; |
Tom Henderson
2015/12/08 01:12:03
delete all instances of AeroRP
Amir.Arc
2016/10/17 03:53:23
Done.
| |
45 | 49 |
46 protected: | 50 protected: |
47 GeographicSet m_geographicSet; | 51 GeographicSet m_geographicSet; |
48 GeographicSet m_tempGeographicSet; | 52 //GeographicSet m_tempGeographicSet; |
49 | 53 |
50 | 54 |
51 public: | 55 public: |
52 SiftGeo () | 56 SiftGeo (); |
Tom Henderson
2015/12/08 01:12:03
do not implement methods in the header files, unle
Amir.Arc
2016/10/17 03:53:23
Done.
| |
53 { | |
54 } | |
55 | 57 |
58 /** param mainAddr Ip Address of node that its geo coordinate should be found | |
59 * returns the geo location of the node | |
60 */ | |
56 GeographicTuple* FindGeographicTuple (const Ipv4Address &mainAddr); | 61 GeographicTuple* FindGeographicTuple (const Ipv4Address &mainAddr); |
62 /** param tuple geo location of the node | |
63 * updates geo location of the nodes if it has changed and set needTiggerUpda te param | |
64 */ | |
57 void InsertGeographicTuple (GeographicTuple const &tuple, bool &needTriggerUpd ate); | 65 void InsertGeographicTuple (GeographicTuple const &tuple, bool &needTriggerUpd ate); |
66 /** param tuple geo location of the node | |
67 * set the default values for the node | |
68 */ | |
58 void EraseGeographicTuple (const GeographicTuple &tuple); | 69 void EraseGeographicTuple (const GeographicTuple &tuple); |
59 void UpdateLinkIsChanged (const Ipv4Address nodeAddress, const Ipv4Address nei ghborAddress, bool isChanged); | 70 |
60 void UpdateLinkIsChanged (bool isChanged); | 71 // void UpdateLinkIsChanged (const Ipv4Address nodeAddress, const Ipv4Address n eighborAddress, bool isChanged); |
72 // void UpdateLinkIsChanged (bool isChanged); | |
73 /** param nodeAddress Ip address of the node | |
74 * Get the status of the node which is being updated | |
75 */ | |
61 bool GetIsBeingUpdated (const Ipv4Address nodeAddress); | 76 bool GetIsBeingUpdated (const Ipv4Address nodeAddress); |
77 /** param nodeAddress Ip address of the node | |
78 * set the status of the node to be isBeingUpdated | |
79 */ | |
62 void SetIsBeingUpdated (const Ipv4Address nodeAddress, bool isBeingUpdated); | 80 void SetIsBeingUpdated (const Ipv4Address nodeAddress, bool isBeingUpdated); |
81 /** | |
82 * set the status of all node to isChanged. | |
83 */ | |
63 void UpdateAllTupleIsChanged (bool isChanged); | 84 void UpdateAllTupleIsChanged (bool isChanged); |
Tom Henderson
2015/12/08 01:12:03
missing doxygen
Amir.Arc
2016/10/17 03:53:23
Done.
| |
85 /** param nodeAddress of a node whose geo location is changed | |
86 * set the status of the node to isChanged. | |
87 */ | |
64 void UpdateTupleIsChanged (const Ipv4Address nodeAddress, bool isChanged); | 88 void UpdateTupleIsChanged (const Ipv4Address nodeAddress, bool isChanged); |
65 void CopyToTempGeographicTuple (void); | 89 //void CopyToTempGeographicTuple (void); |
66 | 90 |
67 //set to store the current topology information | 91 //set to store the current topology information |
68 GeographicSet & GetGeographicInfo () | 92 GeographicSet & GetGeographicInfo () |
69 { | 93 { |
70 return m_geographicSet; | 94 return m_geographicSet; |
71 } | 95 } |
72 | 96 |
73 //set to store the temp infor for calc adj matrix | 97 //Get temporary geo location of the current node |
Tom Henderson
2015/12/08 01:12:03
better Doxygen documentation needed
Amir.Arc
2016/10/17 03:53:23
Done.
Amir.Arc
2016/10/17 03:53:23
The function was removed.
| |
74 GeographicSet & GetTempGeographicInfo () | 98 /* GeographicSet & GetTempGeographicInfo () |
75 { | 99 { |
76 return m_tempGeographicSet; | 100 return m_tempGeographicSet; |
77 } | 101 } */ |
102 | |
78 bool RemoveNodeFromTempSet (Ipv4Address node1Address); | 103 bool RemoveNodeFromTempSet (Ipv4Address node1Address); |
79 | 104 |
80 }; | 105 }; |
81 | 106 |
82 } // namespace sift | 107 } // namespace sift |
83 } // namespace ns3 | 108 } // namespace ns3 |
84 | 109 |
85 #endif | 110 #endif |
LEFT | RIGHT |