packet_channel.h
Go to the documentation of this file.
#ifndef PACKET_CHANNEL_H
#define PACKET_CHANNEL_H
#include <itpp/base/vec.h>
#if (defined(_MSC_VER) && defined(ITPP_SHARED_LIB) && !(defined(itpp_EXPORTS) || defined(itpp_debug_EXPORTS)))
#ifndef ITPP_PROTOCOL_EXCLUDED
#define ITPP_PROTOCOL_EXCLUDED
#pragma message( "PROTOCOL definitions are not available for MSVC shared builds" )
#endif
#else
#include <itpp/protocol/packet.h>
namespace itpp
{
class Packet_Channel
{
public:
Packet_Channel();
Packet_Channel(const double Pr, const Ttype Delay, const double Block_rate, const int Max_slots = 0);
~Packet_Channel();
// -- Slots -- //
Slot<Packet_Channel, bool> start;
Slot<Packet_Channel, Link_Packet*> input;
Slot<Packet_Channel, int> nof_inputs;
// -- Signals -- //
Signal<Link_Packet*> output;
Signal<int> input_request;
Signal<void*> get_nof_inputs;
void set_parameters(const double Pr, const Ttype Delay, const double Block_rate, const int Max_slots);
void set_errors(const ivec &Lost);
private:
void block_rate_loop();
void handle_input(Link_Packet* M);
void handle_start(const bool start);
void handle_nof_inputs(const int N);
bool keep_running;
bool parameters_ok;
bool explicit_errors;
bool lose;
double pr;
Ttype delay;
double block_time;
int max_slots;
ivec lost;
int k, K, L;
};
class ACK_Channel
{
public:
ACK_Channel();
ACK_Channel(const double Pr, const Ttype Delay);
~ACK_Channel();
// -- Slots -- //
Slot<ACK_Channel, ACK*> input;
// -- Signals -- //
Signal<ACK*> output;
void set_parameters(const double Pr, const Ttype Delay);
void set_errors(const ivec& Lost);
private:
void handle_input(ACK* M);
bool parameters_ok;
bool explicit_errors;
bool lose;
double pr;
Ttype delay;
ivec lost;
int k, K, L;
};
} // namespace itpp
#endif
#endif // #ifndef PACKET_CHANNEL_H
itpp::Packet_Channel::nof_inputs
Slot< Packet_Channel, int > nof_inputs
ADD DOCUMENTATION HERE.
Definition: packet_channel.h:69
itpp::Ttype
double Ttype
64-bit floating point time
Definition: events.h:54
itpp::Packet_Channel::input
Slot< Packet_Channel, Link_Packet * > input
ADD DOCUMENTATION HERE.
Definition: packet_channel.h:67
itpp::Packet_Channel::~Packet_Channel
~Packet_Channel()
ADD DOCUMENTATION HERE.
Definition: packet_channel.cpp:50
itpp::Packet_Channel::output
Signal< Link_Packet * > output
ADD DOCUMENTATION HERE.
Definition: packet_channel.h:73
itpp::Packet_Channel
ADD DOCUMENTATION HERE.
Definition: packet_channel.h:52
itpp::ACK_Channel::input
Slot< ACK_Channel, ACK * > input
ADD DOCUMENTATION HERE.
Definition: packet_channel.h:119
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::Packet_Channel
Packet_Channel()
ADD DOCUMENTATION HERE.
Definition: packet_channel.cpp:38
itpp::Packet_Channel::set_errors
void set_errors(const ivec &Lost)
ADD DOCUMENTATION HERE.
Definition: packet_channel.cpp:122
itpp::Packet_Channel::input_request
Signal< int > input_request
ADD DOCUMENTATION HERE.
Definition: packet_channel.h:75
itpp
itpp namespace
Definition: itmex.h:36
itpp::Slot
Slot Class.
Definition: signals_slots.h:57
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::ACK_Channel::output
Signal< ACK * > output
ADD DOCUMENTATION HERE.
Definition: packet_channel.h:123
packet.h
Definition of a Packet class.
itpp::ACK
Definition: packet.h:117
itpp::Link_Packet
Definition: packet.h:97
itpp::ACK_Channel
ADD DOCUMENTATION HERE.
Definition: packet_channel.h:105
itpp::Packet_Channel::start
Slot< Packet_Channel, bool > start
ADD DOCUMENTATION HERE.
Definition: packet_channel.h:65
vec.h
Templated Vector Class Definitions.

Generated on Sat Sep 30 2017 07:04:09 for IT++ by Doxygen 1.8.13