RINASim  October 2016
Documentation of framework for OMNeT++
AEBStream.h
Go to the documentation of this file.
1 //
2 // This program is free software: you can redistribute it and/or modify
3 // it under the terms of the GNU Lesser General Public License as published by
4 // the Free Software Foundation, either version 3 of the License, or
5 // (at your option) any later version.
6 //
7 // This program is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 // GNU Lesser General Public License for more details.
11 //
12 // You should have received a copy of the GNU Lesser General Public License
13 // along with this program. If not, see http://www.gnu.org/licenses/.
14 //
15 
16 #ifndef __RINA_AEBStream_H_
17 #define __RINA_AEBStream_H_
18 
19 #include "AESInt.h"
20 #include <vector>
21 
22 namespace AEBStream {
23 
24 using namespace std;
25 
26 typedef double (*RNG_function)(double, double, int rng);
27 
28 class Stream {
29 public:
30  Stream();
31 
32  void setState(bool);
33 
34  void setBrt(double);
35 
36  void setPduS(int);
37  void setVarPduS(double);
38  void setRNG(RNG_function);
39 
40  void setBurstS(int);
41  void setVarBurstS(double);
42  void setBRNG(RNG_function);
43 
44  void setBurstProb(double);
45 
46  int getid();
47  bool getState();
48  double getWt(int size);
49  int getPDU();
50  int getBurst();
51  double getBurstProb();
52 
53  void compute();
54 
55 
56 private:
57  static int nextId;
58  int id;
59 
60  bool state;
61 
62  double wt, brt;
63 
64  int pduS, burstS;
65  double varPduS, varBurstS;
66  double burstProb;
67 
68  int minPduS, maxPduS;
69  int minBurstS, maxBurstS;
70 
72 };
73 
74 typedef vector<Stream> sVec;
75 typedef sVec::iterator sVecIt;
76 
77 
78 class Stream_Timer : public _AESInt_self {
79 public:
80  int streamId;
81  Stream_Timer(int);
82 };
83 
84 class AEBStream : public AESInt {
85 protected :
86  sVec streams;
87  simtime_t startVar;
88 
89  void doIni();
90  void doFin();
91  void iniCom();
92 
93  void processMsg(_AESInt_self *);
94 };
95 
96 }
97 #endif
vector< Stream > sVec
Definition: AEBStream.h:74
Definition: AESInt.h:47
static int nextId
Definition: AEBStream.h:57
sVec::iterator sVecIt
Definition: AEBStream.h:75
RNG_function rngb
Definition: AEBStream.h:71
simtime_t startVar
Definition: AEBStream.h:87
double(* RNG_function)(double, double, int rng)
Definition: AEBStream.h:26
double burstProb
Definition: AEBStream.h:66