IT++
4.3.1
Toggle main menu visibility
itpp
protocol
packet_channel.h
Go to the documentation of this file.
1
28
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
52
class
Packet_Channel
53
{
54
public
:
56
Packet_Channel
();
58
Packet_Channel
(
const
double
Pr,
const
Ttype
Delay,
const
double
Block_rate,
const
int
Max_slots = 0);
59
61
~Packet_Channel
();
62
63
// -- Slots -- //
65
Slot<Packet_Channel, bool>
start
;
67
Slot<Packet_Channel, Link_Packet*>
input
;
69
Slot<Packet_Channel, int>
nof_inputs
;
70
71
// -- Signals -- //
73
Signal<Link_Packet*>
output
;
75
Signal<int>
input_request
;
77
Signal<void*>
get_nof_inputs
;
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
105
class
ACK_Channel
106
{
107
public
:
109
ACK_Channel
();
110
112
ACK_Channel
(
const
double
Pr,
const
Ttype
Delay);
113
115
~ACK_Channel
();
116
117
// -- Slots -- //
119
Slot<ACK_Channel, ACK*>
input
;
120
121
// -- Signals -- //
123
Signal<ACK*>
output
;
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::set_parameters
void set_parameters(const double Pr, const Ttype Delay)
ADD DOCUMENTATION HERE.
Definition
packet_channel.cpp:150
itpp::ACK_Channel::ACK_Channel
ACK_Channel()
ADD DOCUMENTATION HERE.
Definition
packet_channel.cpp:137
itpp::ACK_Channel::input
Slot< ACK_Channel, ACK * > input
ADD DOCUMENTATION HERE.
Definition
packet_channel.h:119
itpp::ACK_Channel::~ACK_Channel
~ACK_Channel()
ADD DOCUMENTATION HERE.
Definition
packet_channel.cpp:148
itpp::ACK_Channel::set_errors
void set_errors(const ivec &Lost)
ADD DOCUMENTATION HERE.
Definition
packet_channel.cpp:184
itpp::ACK_Channel::output
Signal< ACK * > output
ADD DOCUMENTATION HERE.
Definition
packet_channel.h:123
itpp::ACK
Definition
packet.h:118
itpp::Link_Packet
Definition
packet.h:98
itpp::Packet_Channel::Packet_Channel
Packet_Channel()
ADD DOCUMENTATION HERE.
Definition
packet_channel.cpp:38
itpp::Packet_Channel::input_request
Signal< int > input_request
ADD DOCUMENTATION HERE.
Definition
packet_channel.h:75
itpp::Packet_Channel::~Packet_Channel
~Packet_Channel()
ADD DOCUMENTATION HERE.
Definition
packet_channel.cpp:50
itpp::Packet_Channel::input
Slot< Packet_Channel, Link_Packet * > input
ADD DOCUMENTATION HERE.
Definition
packet_channel.h:67
itpp::Packet_Channel::set_errors
void set_errors(const ivec &Lost)
ADD DOCUMENTATION HERE.
Definition
packet_channel.cpp:122
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::nof_inputs
Slot< Packet_Channel, int > nof_inputs
ADD DOCUMENTATION HERE.
Definition
packet_channel.h:69
itpp::Packet_Channel::start
Slot< Packet_Channel, bool > start
ADD DOCUMENTATION HERE.
Definition
packet_channel.h:65
itpp::Packet_Channel::output
Signal< Link_Packet * > output
ADD DOCUMENTATION HERE.
Definition
packet_channel.h:73
itpp::Packet_Channel::get_nof_inputs
Signal< void * > get_nof_inputs
ADD DOCUMENTATION HERE.
Definition
packet_channel.h:77
itpp::Signal
Signals and slots.
Definition
signals_slots.h:125
itpp::Slot
Slot Class.
Definition
signals_slots.h:221
itpp
itpp namespace
Definition
itmex.h:37
itpp::Ttype
double Ttype
64-bit floating point time
Definition
events.h:54
packet.h
Definition of a Packet class.
vec.h
Templated Vector Class Definitions.
Generated by
1.17.0