RINASim  October 2016
Documentation of framework for OMNeT++
AEData.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_AEData_H_
17 #define __RINA_AEData_H_
18 
19 #include "AESInt.h"
20 #include <vector>
21 
22 namespace AEData {
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 setWaiting();
33  void setSending();
34 
35  void setBrt(double);
36 
37  void setDataS(int);
38  void setVarDataS(double);
39  void setRNG(RNG_function);
40 
41  void setWaitT(double);
42  void setVarWaitT(double);
43  void setWTRNG(RNG_function);
44 
45  int getid();
46  bool getState();
47 
48  int getRemaining();
49  int getNextPDU(int);
50  double getWt(int);
51  double getWait();
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 wData;
65 
66  int dataS;
67  double varDataS;
68  int minDataS, maxDataS;
69 
70  double waitT;
71  double varWaitT;
72  int minWaitT, maxWaitT;
73 
75 };
76 
77 typedef vector<Stream> sVec;
78 typedef sVec::iterator sVecIt;
79 
80 class State_Change : public _AESInt_self {
81 public:
82  int streamId;
83  bool newState;
84  State_Change(int, bool);
85 };
86 
87 class Stream_Timer : public _AESInt_self {
88 public:
89  int streamId;
90  Stream_Timer(int);
91 };
92 
93 class AEData : public AESInt {
94 protected :
95  sVec streams;
96  simtime_t startVar;
97 
98  void doIni();
99  void doFin();
100  void iniCom();
101 
102  void processMsg(_AESInt_self *);
103 };
104 
105 }
106 #endif
sVec::iterator sVecIt
Definition: AEData.h:78
int minDataS
Definition: AEData.h:68
double varWaitT
Definition: AEData.h:71
Definition: AEData.cc:18
double(* RNG_function)(double, double, int rng)
Definition: AEData.h:26
vector< Stream > sVec
Definition: AEData.h:77
Definition: AESInt.h:47
double varDataS
Definition: AEData.h:67
int minWaitT
Definition: AEData.h:72
static int nextId
Definition: AEData.h:57
sVec streams
Definition: AEData.h:95
double waitT
Definition: AEData.h:70
simtime_t startVar
Definition: AEData.h:96
bool state
Definition: AEData.h:60
double wt
Definition: AEData.h:62
RNG_function rngwt
Definition: AEData.h:74