RINASim  October 2016
Documentation of framework for OMNeT++
DQMonitor.h
Go to the documentation of this file.
1 //
2 // Copyright © 2014 - 2015 PRISTINE Consortium (http://ict-pristine.eu)
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Lesser General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (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 Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public License
15 // along with this program. If not, see http://www.gnu.org/licenses/.
16 //
17 
18 #ifndef DQMonitor_H_
19 #define DQMonitor_H_
20 
21 #include "SmartMonitor.h"
22 
23 #include "dlCUInfo.h"
24 
25 #include <string>
26 #include <map>
27 #include <vector>
28 #include <list>
29 
30 namespace DQMonitor {
31 
32 using namespace std;
33 
34 typedef std::map<std::string, L> lRepo;
35 typedef std::map<std::string, C> cRepo;
36 typedef std::map<std::string, U> uRepo;
37 typedef std::map<std::string, dlCUInfo> cuRepo;
38 
39 
40 typedef std::map<RMTQueue*, dlCUInfo*> queue2CU;
41 
42 
43 typedef list<RMTQueue*> QueuesList;
44 typedef map<RMTPort*, RMTQueue* > port2Queue;
45 typedef map<RMTPort*, QueuesList > port2Queues;
46 
47 /*
48 typedef cuRepo::iterator cuRepoiterator;
49 
50 
51 
52 typedef std::map<int, QueuesList> PriorityQueuesList;
53 typedef PriorityQueuesList::iterator PQListIterator;
54 typedef PriorityQueuesList::reverse_iterator PQListRIterator;
55 
56 typedef std::map<RMTPort*, PriorityQueuesList> Port2PQ;
57 */
58 
59 class DQMonitor : public SmartMonitor
60 {
61 public:
62  void onPolicyInit();
63  void postPDUInsertion(RMTQueue* queue);
64  void onMessageDrop(RMTQueue* queue, const cPacket* pdu);
65  void postQueueCreation(RMTQueue* queue);
66 
67 // int getInCount(RMTPort* port);
68 // int getInThreshold(RMTQueue * queue);
69 
70  double getInDropProb(RMTQueue * queue);
71  RMTQueue* getNextInput(RMTPort* port);
72  simtime_t getNextInputTime(RMTPort* port);
73 
74 // int getOutCount(RMTPort* port);
75 // int getOutThreshold(RMTQueue * queue);
76 
77  double getOutDropProb(RMTQueue * queue);
78  RMTQueue* getNextOutput(RMTPort* port);
79 
80  protected:
81  lRepo Ls;
82  cRepo Cs;
83  uRepo Us;
84  cuRepo CUs;
85  queue2CU Q2CU;
86 
87  map< RMTPort*, map<L*, list<simtime_t> > > LTimes;
88  map< RMTPort*, map<L*, list<simtime_t> > > SpaceTimes;
89  map< RMTPort*, simtime_t> nextServe;
90 
91  map< RMTPort*, map<L*, list<RMTQueue*> > > LQueues;
92 
93  map< RMTQueue*, list<simtime_t> > UTimes;
94  map< RMTQueue*, int > lastUrgency;
95 
96  map< RMTPort*, map<int, list<RMTQueue*> > > UQueues;
97 
98  map<RMTPort*, unsigned int > outC;
99 
100  void parseL(cXMLElement* xml);
101  void parseC(cXMLElement* xml);
102  void parseU(cXMLElement* xml);
103 };
104 
105 }
106 
107 #endif /* SIMPLEMONITOR_H_ */
std::map< std::string, L > lRepo
Definition: DQMonitor.h:34
map< RMTPort *, map< L *, list< simtime_t > > > SpaceTimes
Definition: DQMonitor.h:88
map< RMTPort *, map< L *, list< simtime_t > > > LTimes
Definition: DQMonitor.h:87
map< RMTQueue *, list< simtime_t > > UTimes
Definition: DQMonitor.h:93
std::map< RMTQueue *, dlCUInfo * > queue2CU
Definition: DQMonitor.h:40
map< RMTPort *, map< L *, list< RMTQueue * > > > LQueues
Definition: DQMonitor.h:91
std::map< std::string, dlCUInfo > cuRepo
Definition: DQMonitor.h:37
map< RMTPort *, simtime_t > nextServe
Definition: DQMonitor.h:89
map< RMTPort *, RMTQueue * > port2Queue
Definition: DQMonitor.h:44
map< RMTPort *, QueuesList > port2Queues
Definition: DQMonitor.h:45
std::map< std::string, U > uRepo
Definition: DQMonitor.h:36
map< RMTPort *, unsigned int > outC
Definition: DQMonitor.h:98
map< RMTPort *, map< int, list< RMTQueue * > > > UQueues
Definition: DQMonitor.h:96
list< RMTQueue * > QueuesList
Definition: DQMonitor.h:43
std::map< std::string, C > cRepo
Definition: DQMonitor.h:35
map< RMTQueue *, int > lastUrgency
Definition: DQMonitor.h:94