IT++ Logo
front_drop_queue.h
Go to the documentation of this file.
1
28#ifndef FRONT_DROP_QUEUE_H
29#define FRONT_DROP_QUEUE_H
30
31#include <itpp/itexports.h>
32
33#if (defined(_MSC_VER) && defined(ITPP_SHARED_LIB) && !(defined(itpp_EXPORTS) || defined(itpp_debug_EXPORTS)))
34
35#ifndef ITPP_PROTOCOL_EXCLUDED
36#define ITPP_PROTOCOL_EXCLUDED
37#pragma message( "PROTOCOL definitions are not available for MSVC shared builds" )
38#endif
39
40#else
41
44
45
46namespace itpp
47{
48
50
51
53#define DEFAULT_MAX_BYTES_IN_QUEUE 24000
54
56class Front_Drop_Queue : public virtual std::queue<Packet*>
57{
58public:
61 max_bytes_in_queue = max_bytes;
62 bytes_in_queue = 0;
63 debug = false;
64 }
65
66 // TODO destructor
67 // ~FrontDropQueue() { }
68
70 void set_debug(const bool enable_debug = true) {
71 debug = enable_debug;
72 }
73
75 void push(Packet *packet);
77 void pop();
78
80 void set_max_byte_size(int max_bytes) { max_bytes_in_queue = max_bytes; }
82 int max_byte_size() { return max_bytes_in_queue; }
84 int byte_size() { return bytes_in_queue; }
85
86private:
87 int max_bytes_in_queue;
88 int bytes_in_queue;
89 int debug;
90};
91
93
94} // namespace itpp
95
96#endif
97
98#endif // #ifndef FRONT_DROP_QUEUE_H
99
ADD DOCUMENTATION HERE.
void pop()
ADD DOCUMENTATION HERE.
int byte_size()
ADD DOCUMENTATION HERE.
void push(Packet *packet)
ADD DOCUMENTATION HERE.
Front_Drop_Queue(const int max_bytes=DEFAULT_MAX_BYTES_IN_QUEUE)
ADD DOCUMENTATION HERE.
void set_max_byte_size(int max_bytes)
ADD DOCUMENTATION HERE.
void set_debug(const bool enable_debug=true)
ADD DOCUMENTATION HERE.
int max_byte_size()
ADD DOCUMENTATION HERE.
Definitions of an event-based simulation class.
#define DEFAULT_MAX_BYTES_IN_QUEUE
ADD DOCUMENTATION HERE.
itpp namespace
Definition: itmex.h:37
Definition of a Packet class.
SourceForge Logo

Generated on Sun Jun 5 2022 21:26:42 for IT++ by Doxygen 1.9.3