RINASim  October 2016
Documentation of framework for OMNeT++
MM_WFQ_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_WFQ_Out {
28 
29 using namespace std;
30 
31 struct QConfig {
32  int rTkBit;
33  int sTkBit;
34  int maxTk;
35  int priority;
36 
37  QConfig();
38 };
39 
40 struct Qinfo {
41  bool hasTk;
42  int priority;
43 
44  Qinfo();
45  Qinfo(const bool & _ht, const int & _pr);
46 
47  bool compare(const Qinfo & o);
48 };
49 
50 struct QData {
51  int tk;
52  int w;
54 
55  QData();
56  void addTk(const int & s);
57  void remTk(const int & s);
58  Qinfo getInfo(const int & nextS);
59 };
60 
62 {
63  public:
64  ~MM_WFQ_Out();
65  void finish();
66 
67  void pduInsertered(RMTQueue *, RMTPort *);
68  void pduDropped(RMTQueue *, const cPacket *, RMTPort *);
69  void pduReleased(RMTQueue *, RMTPort *);
70  void queueCreated(RMTQueue *, RMTPort *);
71 
72  RMTQueue * getnextQueue(RMTPort *);
73  simtime_t getnextTime(RMTPort *);
74 
75  protected:
76  map<string , QConfig> queueName2Config;
79  map<RMTQueue * , QData> queueData;
80 
81  map<RMTPort* , list<RMTQueue*> > portQueues;
82 
83  void initialize();
84 };
85 
86 }
map< RMTQueue *, QData > queueData
Definition: MM_WFQ_Out.h:79
map< RMTPort *, list< RMTQueue * > > portQueues
Definition: MM_WFQ_Out.h:81
map< string, QConfig > queueName2Config
Definition: MM_WFQ_Out.h:76