packet.h
Go to the documentation of this file.
#ifndef PACKET_H
#define PACKET_H
#include <itpp/itexports.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/signals_slots.h>
namespace itpp
{
class Packet
{
public:
Packet(const int packet_size = 0) { set_bit_size(packet_size); }
virtual ~Packet() {}
void set_bit_size(int packet_size) { it_assert(packet_size >= 0, "Packet size must be positive"); size_bits = packet_size; }
int bit_size() { return size_bits; }
private:
int size_bits; // size of packet in bits
};
class L3_Packet_Info
{
public:
L3_Packet_Info(Packet *packet) { timestamp = 0; pkt_pointer = packet; }
~L3_Packet_Info() {}
Ttype timestamp;
Packet *pkt_pointer;
};
class Link_Packet : public Packet
{
public:
Link_Packet(const int Seq_no, const unsigned long int Link_packet_id, L3_Packet_Info *Cp) { seq_no = Seq_no; link_packet_id = Link_packet_id; l3_pkt_info_p = Cp; }
~Link_Packet() {}
unsigned long int link_packet_id;
int seq_no;
L3_Packet_Info *l3_pkt_info_p;
};
class ACK : public Packet
{
public:
ACK(const int Seq_no = -1, const int Id = 0) { seq_no = Seq_no; id = Id; }
~ACK() {}
int id;
int seq_no;
};
} // namespace itpp
#endif
#endif // #ifndef PACKET_H
itpp::ACK::ACK
ACK(const int Seq_no=-1, const int Id=0)
ADD DOCUMENTATION HERE.
Definition packet.h:121
itpp::ACK::seq_no
int seq_no
ADD DOCUMENTATION HERE.
Definition packet.h:129
itpp::ACK::~ACK
~ACK()
ADD DOCUMENTATION HERE.
Definition packet.h:124
itpp::ACK::id
int id
ADD DOCUMENTATION HERE.
Definition packet.h:127
itpp::L3_Packet_Info
Definition packet.h:78
itpp::L3_Packet_Info::pkt_pointer
Packet * pkt_pointer
ADD DOCUMENTATION HERE.
Definition packet.h:90
itpp::L3_Packet_Info::L3_Packet_Info
L3_Packet_Info(Packet *packet)
ADD DOCUMENTATION HERE.
Definition packet.h:81
itpp::L3_Packet_Info::timestamp
Ttype timestamp
ADD DOCUMENTATION HERE.
Definition packet.h:87
itpp::L3_Packet_Info::~L3_Packet_Info
~L3_Packet_Info()
ADD DOCUMENTATION HERE.
Definition packet.h:84
itpp::Link_Packet::link_packet_id
unsigned long int link_packet_id
ADD DOCUMENTATION HERE.
Definition packet.h:107
itpp::Link_Packet::seq_no
int seq_no
ADD DOCUMENTATION HERE.
Definition packet.h:109
itpp::Link_Packet::Link_Packet
Link_Packet(const int Seq_no, const unsigned long int Link_packet_id, L3_Packet_Info *Cp)
ADD DOCUMENTATION HERE.
Definition packet.h:101
itpp::Link_Packet::~Link_Packet
~Link_Packet()
ADD DOCUMENTATION HERE.
Definition packet.h:104
itpp::Link_Packet::l3_pkt_info_p
L3_Packet_Info * l3_pkt_info_p
ADD DOCUMENTATION HERE.
Definition packet.h:111
itpp::Packet
Definition packet.h:56
itpp::Packet::bit_size
int bit_size()
get size of packet in bits
Definition packet.h:67
itpp::Packet::set_bit_size
void set_bit_size(int packet_size)
set size of packet in bits
Definition packet.h:64
itpp::Packet::~Packet
virtual ~Packet()
ADD DOCUMENTATION HERE.
Definition packet.h:61
itpp::Packet::Packet
Packet(const int packet_size=0)
ADD DOCUMENTATION HERE.
Definition packet.h:59
it_assert
#define it_assert(t, s)
Abort if t is not true.
Definition itassert.h:94
itpp
itpp namespace
Definition itmex.h:37
itpp::Ttype
double Ttype
64-bit floating point time
Definition events.h:54
signals_slots.h
Definitions of Signals and Slots classes.

Generated on for IT++ by Doxygen 1.15.0