OverSim
SearchMsgBookkeeping.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2006 Institut fuer Telematik, Universitaet Karlsruhe (TH)
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 //
18 
19 
25 #ifndef __SEARCHMSGBOOKKEEPING_H_
26 #define __SEARCHMSGBOOKKEEPING_H_
27 
28 #include <map>
29 
30 #include <omnetpp.h>
31 
32 #include <OverlayKey.h>
33 
40 {
41  float minDelay;
42  float maxDelay;
43  float minHopCount;
44  float maxHopCount;
45  float responseCount;
46 };
47 
54 {
55 public:
56 
61  {
63  simtime_t creationTime;
64  simtime_t minDelay;
65  simtime_t maxDelay;
66  uint32_t minHopCount;
67  uint32_t maxHopCount;
68  uint32_t responseCount;
69  };
70 
71  typedef std::map<OverlayKey, SearchMessageItem>
73  typedef std::map<OverlayKey, SearchMessageItem>::iterator
75  typedef std::map<OverlayKey, SearchMessageItem>::const_iterator
82 
88  uint32_t getSize() const;
89 
95  void addMessage(const OverlayKey& searchKey);
96 
102  void removeMessage(const OverlayKey& searchKey);
103 
110  bool contains(const OverlayKey& searchKey) const;
111 
118  void updateItem(const OverlayKey& searchKey, uint32_t hopCount);
119 
126 
127 protected:
128 
130 };
131 
132 #endif