Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
itpp
protocol
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
42
#include <
itpp/protocol/packet.h
>
43
#include <
itpp/protocol/events.h
>
44
45
46
namespace
itpp
47
{
48
50
51
53
#define DEFAULT_MAX_BYTES_IN_QUEUE 24000
54
56
class
Front_Drop_Queue
:
public
virtual
std::queue<Packet*>
57
{
58
public
:
60
Front_Drop_Queue
(
const
int
max_bytes =
DEFAULT_MAX_BYTES_IN_QUEUE
) {
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
86
private
:
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
Generated on Sat May 25 2013 16:32:23 for IT++ by
Doxygen
1.8.2