RINASim  October 2016
Documentation of framework for OMNeT++
AEVoice.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_AEVoice_H_
17 #define __RINA_AEVoice_H_
18 
19 #include "AESInt.h"
20 #include <vector>
21 
22 namespace AEVoice {
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 setWt(double);
33  void setBrt(double);
34  void setAvgSTime(double);
35  void setAvgWTime(double);
36  void setVarSTime(double);
37  void setVarWTime(double);
38  void setRNG(RNG_function);
39  void setState(bool);
40 
41  int getid();
42  double nexSendT();
43  double nexWaitT();
44  double getWt();
45  int getDataSize();
46  bool getState();
47 
48  void compute();
49 
50 
51 private:
52  static int nextId;
53  int id;
54  bool state;
55 
56  double wt, brt;
57 
59 
60  double minSTime, maxSTime;
61  double minWTime, maxWTime;
62 
63  double avgSTime, avgWTime;
64  double varSTime, varWTime;
66 };
67 
68 typedef vector<Stream> sVec;
69 typedef sVec::iterator sVecIt;
70 
71 class State_Change : public _AESInt_self {
72 public:
73  int streamId;
74  bool newState;
75  State_Change(int, bool);
76 };
77 
78 class Stream_Timer : public _AESInt_self {
79 public:
80  int streamId;
81  Stream_Timer(int);
82 };
83 
84 class AEVoice : 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
double varWTime
Definition: AEVoice.h:64
sVec::iterator sVecIt
Definition: AEVoice.h:69
simtime_t startVar
Definition: AEVoice.h:87
double minSTime
Definition: AEVoice.h:60
static int nextId
Definition: AEVoice.h:52
double minWTime
Definition: AEVoice.h:61
double avgWTime
Definition: AEVoice.h:63
Definition: AESInt.h:47
vector< Stream > sVec
Definition: AEVoice.h:68
double(* RNG_function)(double, double, int rng)
Definition: AEVoice.h:26
int packetSize
Definition: AEVoice.h:58
double wt
Definition: AEVoice.h:56
RNG_function rng
Definition: AEVoice.h:65