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
44
45namespace itpp
46{
47
49
50
53{
54public:
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
85private:
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{
107public:
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
130private:
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
ADD DOCUMENTATION HERE.
void set_parameters(const double Pr, const Ttype Delay)
ADD DOCUMENTATION HERE.
ACK_Channel()
ADD DOCUMENTATION HERE.
Slot< ACK_Channel, ACK * > input
ADD DOCUMENTATION HERE.
~ACK_Channel()
ADD DOCUMENTATION HERE.
void set_errors(const ivec &Lost)
ADD DOCUMENTATION HERE.
Signal< ACK * > output
ADD DOCUMENTATION HERE.
ADD DOCUMENTATION HERE.
Packet_Channel()
ADD DOCUMENTATION HERE.
Signal< int > input_request
ADD DOCUMENTATION HERE.
~Packet_Channel()
ADD DOCUMENTATION HERE.
Slot< Packet_Channel, Link_Packet * > input
ADD DOCUMENTATION HERE.
void set_errors(const ivec &Lost)
ADD DOCUMENTATION HERE.
void set_parameters(const double Pr, const Ttype Delay, const double Block_rate, const int Max_slots)
ADD DOCUMENTATION HERE.
Slot< Packet_Channel, int > nof_inputs
ADD DOCUMENTATION HERE.
Slot< Packet_Channel, bool > start
ADD DOCUMENTATION HERE.
Signal< Link_Packet * > output
ADD DOCUMENTATION HERE.
Signal< void * > get_nof_inputs
ADD DOCUMENTATION HERE.
Signals and slots.
Slot Class.
itpp namespace
Definition: itmex.h:37
double Ttype
64-bit floating point time
Definition: events.h:54
Definition of a Packet class.
Templated Vector Class Definitions.
SourceForge Logo

Generated on Tue Jan 24 2023 00:00:00 for IT++ by Doxygen 1.9.5