IT++ Logo
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/base/vec.h>
33 
34 #if (defined(_MSC_VER) && defined(ITPP_SHARED_LIB) && !(defined(itpp_EXPORTS) || defined(itpp_debug_EXPORTS)))
35 
36 #ifndef ITPP_PROTOCOL_EXCLUDED
37 #define ITPP_PROTOCOL_EXCLUDED
38 #pragma message( "PROTOCOL definitions are not available for MSVC shared builds" )
39 #endif
40 
41 #else
42 
43 #include <itpp/protocol/packet.h>
44 
45 namespace itpp
46 {
47 
49 
50 
53 {
54 public:
58  Packet_Channel(const double Pr, const Ttype Delay, const double Block_rate, const int Max_slots = 0);
59 
62 
63  // -- Slots -- //
70 
71  // -- Signals -- //
78 
80  void set_parameters(const double Pr, const Ttype Delay, const double Block_rate, const int Max_slots);
81 
83  void set_errors(const ivec &Lost);
84 
85 private:
86  void block_rate_loop();
87  void handle_input(Link_Packet* M);
88  void handle_start(const bool start);
89  void handle_nof_inputs(const int N);
90 
91  bool keep_running;
92  bool parameters_ok;
93  bool explicit_errors;
94  bool lose;
95  double pr;
96  Ttype delay;
97  double block_time;
98  int max_slots;
99  ivec lost;
100  int k, K, L;
101 };
102 
103 
106 {
107 public:
109  ACK_Channel();
110 
112  ACK_Channel(const double Pr, const Ttype Delay);
113 
115  ~ACK_Channel();
116 
117  // -- Slots -- //
120 
121  // -- Signals -- //
124 
126  void set_parameters(const double Pr, const Ttype Delay);
128  void set_errors(const ivec& Lost);
129 
130 private:
131  void handle_input(ACK* M);
132 
133  bool parameters_ok;
134  bool explicit_errors;
135  bool lose;
136  double pr;
137  Ttype delay;
138  ivec lost;
139  int k, K, L;
140 };
141 
143 
144 } // namespace itpp
145 
146 #endif
147 
148 #endif // #ifndef PACKET_CHANNEL_H
149 
itpp::ACK_Channel::ACK_Channel
ACK_Channel()
ADD DOCUMENTATION HERE.
Definition: packet_channel.cpp:137
itpp::Packet_Channel::Packet_Channel
Packet_Channel()
ADD DOCUMENTATION HERE.
Definition: packet_channel.cpp:38
itpp::Ttype
double Ttype
64-bit floating point time
Definition: events.h:54
itpp::Signal
Signals and slots.
Definition: signals_slots.h:55
itpp::Packet_Channel::get_nof_inputs
Signal< void * > get_nof_inputs
ADD DOCUMENTATION HERE.
Definition: packet_channel.h:77
itpp
itpp namespace
Definition: itmex.h:36
itpp::Packet_Channel
ADD DOCUMENTATION HERE.
Definition: packet_channel.h:52
itpp::Packet_Channel::input
Slot< Packet_Channel, Link_Packet * > input
ADD DOCUMENTATION HERE.
Definition: packet_channel.h:67
itpp::ACK_Channel::input
Slot< ACK_Channel, ACK * > input
ADD DOCUMENTATION HERE.
Definition: packet_channel.h:119
itpp::ACK_Channel
ADD DOCUMENTATION HERE.
Definition: packet_channel.h:105
itpp::Slot
Slot Class.
Definition: signals_slots.h:57
itpp::Packet_Channel::output
Signal< Link_Packet * > output
ADD DOCUMENTATION HERE.
Definition: packet_channel.h:73
itpp::Packet_Channel::set_parameters
void set_parameters(const double Pr, const Ttype Delay, const double Block_rate, const int Max_slots)
ADD DOCUMENTATION HERE.
Definition: packet_channel.cpp:52
itpp::Packet_Channel::set_errors
void set_errors(const ivec &Lost)
ADD DOCUMENTATION HERE.
Definition: packet_channel.cpp:122
packet.h
Definition of a Packet class.
itpp::Packet_Channel::input_request
Signal< int > input_request
ADD DOCUMENTATION HERE.
Definition: packet_channel.h:75
itpp::Packet_Channel::start
Slot< Packet_Channel, bool > start
ADD DOCUMENTATION HERE.
Definition: packet_channel.h:65
itpp::Packet_Channel::~Packet_Channel
~Packet_Channel()
ADD DOCUMENTATION HERE.
Definition: packet_channel.cpp:50
itpp::ACK_Channel::output
Signal< ACK * > output
ADD DOCUMENTATION HERE.
Definition: packet_channel.h:123
vec.h
Templated Vector Class Definitions.
itpp::Packet_Channel::nof_inputs
Slot< Packet_Channel, int > nof_inputs
ADD DOCUMENTATION HERE.
Definition: packet_channel.h:69
itpp::ACK_Channel::set_errors
void set_errors(const ivec &Lost)
ADD DOCUMENTATION HERE.
Definition: packet_channel.cpp:184
itpp::ACK_Channel::~ACK_Channel
~ACK_Channel()
ADD DOCUMENTATION HERE.
Definition: packet_channel.cpp:148
itpp::ACK_Channel::set_parameters
void set_parameters(const double Pr, const Ttype Delay)
ADD DOCUMENTATION HERE.
Definition: packet_channel.cpp:150
itpp::ACK
Definition: packet.h:117

Generated on Mon Mar 23 2020 06:18:03 for IT++ by Doxygen 1.8.17