IT++ Logo
packet.h
Go to the documentation of this file.
1
29#ifndef PACKET_H
30#define PACKET_H
31
32#include <itpp/itexports.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
45
46namespace itpp
47{
48
50
51
55class Packet
56{
57public:
59 Packet(const int packet_size = 0) { set_bit_size(packet_size); }
61 virtual ~Packet() {}
62
64 void set_bit_size(int packet_size) { it_assert(packet_size >= 0, "Packet size must be positive"); size_bits = packet_size; }
65
67 int bit_size() { return size_bits; }
68
69private:
70 int size_bits; // size of packet in bits
71};
72
73
92
93
97class Link_Packet : public Packet
98{
99public:
102
105
107 unsigned long int link_packet_id;
112};
113
117class ACK : public Packet
118{
119public:
121 ACK(const int Seq_no = -1, const int Id = 0) { seq_no = Seq_no; id = Id; }
122
124 ~ACK() {}
125
127 int id;
130};
131
133
134} // namespace itpp
135
136#endif
137
138#endif // #ifndef PACKET_H
139
ACK(const int Seq_no=-1, const int Id=0)
ADD DOCUMENTATION HERE.
Definition packet.h:121
int seq_no
ADD DOCUMENTATION HERE.
Definition packet.h:129
~ACK()
ADD DOCUMENTATION HERE.
Definition packet.h:124
int id
ADD DOCUMENTATION HERE.
Definition packet.h:127
General array class.
Definition array.h:105
Packet * pkt_pointer
ADD DOCUMENTATION HERE.
Definition packet.h:90
L3_Packet_Info(Packet *packet)
ADD DOCUMENTATION HERE.
Definition packet.h:81
Ttype timestamp
ADD DOCUMENTATION HERE.
Definition packet.h:87
~L3_Packet_Info()
ADD DOCUMENTATION HERE.
Definition packet.h:84
int bit_size()
get size of packet in bits
Definition packet.h:67
void set_bit_size(int packet_size)
set size of packet in bits
Definition packet.h:64
virtual ~Packet()
ADD DOCUMENTATION HERE.
Definition packet.h:61
Packet(const int packet_size=0)
ADD DOCUMENTATION HERE.
Definition packet.h:59
#define it_assert(t, s)
Abort if t is not true.
Definition itassert.h:94
itpp namespace
Definition itmex.h:37
Definitions of Signals and Slots classes.

Generated on Tue Aug 17 2021 10:59:15 for IT++ by Doxygen 1.9.8