IT++ Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
packet_channel.h
Go to the documentation of this file.
1 
29 #ifndef PACKET_CHANNEL_H
30 #define PACKET_CHANNEL_H
31 
32 #include <itpp/protocol/packet.h>
33 #include <itpp/base/vec.h>
34 
35 
36 namespace itpp
37 {
38 
40 
41 
44 {
45 public:
49  Packet_Channel(const double Pr, const Ttype Delay, const double Block_rate, const int Max_slots = 0);
50 
53 
54  // -- Slots -- //
61 
62  // -- Signals -- //
69 
71  void set_parameters(const double Pr, const Ttype Delay, const double Block_rate, const int Max_slots);
72 
74  void set_errors(const ivec &Lost);
75 
76 private:
77  void block_rate_loop();
78  void handle_input(Link_Packet* M);
79  void handle_start(const bool start);
80  void handle_nof_inputs(const int N);
81 
82  bool keep_running;
83  bool parameters_ok;
84  bool explicit_errors;
85  bool lose;
86  double pr;
87  Ttype delay;
88  double block_time;
89  int max_slots;
90  ivec lost;
91  int k, K, L;
92 };
93 
94 
97 {
98 public:
100  ACK_Channel();
101 
103  ACK_Channel(const double Pr, const Ttype Delay);
104 
106  ~ACK_Channel();
107 
108  // -- Slots -- //
111 
112  // -- Signals -- //
115 
117  void set_parameters(const double Pr, const Ttype Delay);
119  void set_errors(const ivec& Lost);
120 
121 private:
122  void handle_input(ACK* M);
123 
124  bool parameters_ok;
125  bool explicit_errors;
126  bool lose;
127  double pr;
128  Ttype delay;
129  ivec lost;
130  int k, K, L;
131 };
132 
134 
135 } // namespace itpp
136 
137 #endif // #ifndef PACKET_CHANNEL_H
138 
SourceForge Logo

Generated on Fri Mar 21 2014 17:14:13 for IT++ by Doxygen 1.8.1.2