OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (c) 2010 ResiliNets, University of Kansas |
| 3 * |
| 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 |
| 6 * published by the Free Software Foundation; |
| 7 * |
| 8 * This program is distributed in the hope that it will be useful, |
| 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 * GNU General Public License for more details. |
| 12 * |
| 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 |
| 15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 16 * |
| 17 * Authors: Kevin Peters <kevjay@gmail.com> |
| 18 * Hemanth Narra <hemanthnarra222@gmail.com> |
| 19 * |
| 20 * ResiliNets at The University of Kansas <https://wiki.ittc.ku.edu/resilinets/M
ain_Page> |
| 21 * Minor changes was done by Amir Modarresi |
| 22 */ |
| 23 |
| 24 #ifndef SIFT_REPOSITORIES_H |
| 25 #define SIFT_REPOSITORIES_H |
| 26 |
| 27 #include <set> |
| 28 #include <vector> |
| 29 #include <map> |
| 30 #include "ns3/event-id.h" |
| 31 |
| 32 #include "ns3/ipv4-address.h" |
| 33 #include "ns3/nstime.h" |
| 34 |
| 35 namespace ns3 { |
| 36 namespace sift { |
| 37 |
| 38 |
| 39 /// A Geographic Tuple. |
| 40 struct GeographicTuple |
| 41 { |
| 42 /// Main address of a neighbor node. |
| 43 Ipv4Address nodeAddr; |
| 44 Ipv4Address nodeReceivedFrom; |
| 45 |
| 46 /// coordinate of the neighbor |
| 47 uint32_t xcoord; |
| 48 uint32_t ycoord; |
| 49 uint32_t zcoord; |
| 50 |
| 51 /// velocity of the neighbor in each axis |
| 52 int16_t xvelocity; |
| 53 int16_t yvelocity; |
| 54 int16_t zvelocity; |
| 55 |
| 56 Time recordedTime; |
| 57 Time dataRecordedTime; |
| 58 Time startTime; |
| 59 Time expireTime; |
| 60 |
| 61 /// this is set when this node has incorrect info and I am trying to update it
. |
| 62 // this variable helps immensely to cut down on the number of re-updates |
| 63 bool isBeingUpdated; |
| 64 |
| 65 /// Keep the status of velocity vector. If it is TRUE the value of the |
| 66 // velocity vector should be updated. |
| 67 bool isChanged; |
| 68 }; |
| 69 |
| 70 static inline bool |
| 71 operator == (const GeographicTuple &a, const GeographicTuple &b) |
| 72 { |
| 73 return (a.nodeAddr == b.nodeAddr); |
| 74 } |
| 75 |
| 76 static inline std::ostream& |
| 77 operator << (std::ostream &os, const GeographicTuple &tuple) |
| 78 { |
| 79 os << "GeographicTuple(nodeAddr=" << tuple.nodeAddr |
| 80 << ", nodeReceivedFrom=" << tuple.nodeReceivedFrom |
| 81 << ", lastrecordedtime=" << tuple.recordedTime |
| 82 << ", dataRecordedTime=" << tuple.dataRecordedTime |
| 83 << ", startTime=" << tuple.startTime |
| 84 << ", expireTime=" << tuple.expireTime |
| 85 << ", isChanged=" << tuple.isChanged |
| 86 << ", xlocation=" << tuple.xcoord |
| 87 << ", ylocation=" << tuple.ycoord |
| 88 << ", zlocation=" << tuple.zcoord |
| 89 << ", xvelocity=" << tuple.xvelocity |
| 90 << ", yvelocity=" << tuple.yvelocity |
| 91 << ", zvelocity=" << tuple.zvelocity << ")"; |
| 92 return os; |
| 93 } |
| 94 |
| 95 typedef std::vector<GeographicTuple> GeographicSet; ///< Geographic Set type. |
| 96 |
| 97 } // namespace sift |
| 98 } // namespace ns3 |
| 99 |
| 100 #endif /* SIFT_REPOSITORIES_H */ |
OLD | NEW |