RINASim  October 2016
Documentation of framework for OMNeT++
MM_DQ_Out.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 #pragma once
19 
20 #include "Int_MM_Out_Module.h"
21 
22 #include <string>
23 #include <map>
24 #include <vector>
25 #include <list>
26 
27 namespace MM_DQ_Out {
28 
29 using namespace std;
30 
31 struct UrgLimit {
32  double limit;
33  int urg;
34 
35  UrgLimit(double, int);
36 };
37 
38 struct DegradList {
39  simtime_t t;
40  vector<UrgLimit> urgList;
41 
42  DegradList(double);
43 };
44 
45 struct QueueConfig {
46  string id;
48  double rate;
49  vector<DegradList> degradLists;
50 
51  QueueConfig();
52  QueueConfig(string, int);
53 };
54 
55 struct QueueData {
56  int count;
57  list<simtime_t> inTimes;
58  list<simtime_t> outTimes;
59  map<int, int> countUrg;
61 
62 
63  map<int, int> countUrgstats;
64 
65  QueueData();
66 };
67 
69 {
70  public:
71  ~MM_DQ_Out();
72  void finish();
73 
74  void pduInsertered(RMTQueue *, RMTPort *);
75  void pduDropped(RMTQueue *, const cPacket *, RMTPort *);
76  void pduReleased(RMTQueue *, RMTPort *);
77  void queueCreated(RMTQueue *, RMTPort *);
78 
79  RMTQueue * getnextQueue(RMTPort *);
80  simtime_t getnextTime(RMTPort *);
81 
82  protected:
83  map<string, QueueConfig> queuesConf;
84  map<RMTQueue *, QueueConfig *> queueConf;
85  map<RMTQueue *, QueueData> queueData;
86 
87  // map<string , int> queueName2Priority;
90  // map<RMTQueue * , int> queuePriority;
91  // map<int, double> prioritySkip;
92 
93  map<RMTPort* , set<RMTQueue*> > portQueues;
94 
95  void initialize();
96 };
97 
98 }
map< int, int > countUrg
Definition: MM_DQ_Out.h:59
map< RMTPort *, set< RMTQueue * > > portQueues
Definition: MM_DQ_Out.h:93
map< RMTQueue *, QueueData > queueData
Definition: MM_DQ_Out.h:85
vector< UrgLimit > urgList
Definition: MM_DQ_Out.h:40
map< RMTQueue *, QueueConfig * > queueConf
Definition: MM_DQ_Out.h:84
vector< DegradList > degradLists
Definition: MM_DQ_Out.h:49
map< string, QueueConfig > queuesConf
Definition: MM_DQ_Out.h:83
list< simtime_t > inTimes
Definition: MM_DQ_Out.h:57
map< int, int > countUrgstats
Definition: MM_DQ_Out.h:63
list< simtime_t > outTimes
Definition: MM_DQ_Out.h:58