Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
itpp
protocol
front_drop_queue.h
Go to the documentation of this file.
1
29
#ifndef FRONT_DROP_QUEUE_H
30
#define FRONT_DROP_QUEUE_H
31
32
#include <
itpp/protocol/packet.h
>
33
#include <
itpp/protocol/events.h
>
34
35
36
namespace
itpp
37
{
38
40
41
43
#define DEFAULT_MAX_BYTES_IN_QUEUE 24000
44
46
class
Front_Drop_Queue
:
public
virtual
std::queue<Packet*>
47
{
48
public
:
50
Front_Drop_Queue
(
const
int
max_bytes =
DEFAULT_MAX_BYTES_IN_QUEUE
) {
51
max_bytes_in_queue = max_bytes;
52
bytes_in_queue = 0;
53
debug =
false
;
54
}
55
56
// TODO destructor
57
// ~FrontDropQueue() { }
58
60
void
set_debug
(
const
bool
enable_debug =
true
) {
61
debug = enable_debug;
62
}
63
65
void
push
(
Packet
*packet);
67
void
pop
();
68
70
void
set_max_byte_size
(
int
max_bytes) { max_bytes_in_queue = max_bytes; }
72
int
max_byte_size
() {
return
max_bytes_in_queue; }
74
int
byte_size
() {
return
bytes_in_queue; }
75
76
private
:
77
int
max_bytes_in_queue;
78
int
bytes_in_queue;
79
int
debug;
80
};
81
83
84
}
// namespace itpp
85
86
#endif // #ifndef FRONT_DROP_QUEUE_H
87
Generated on Fri Mar 21 2014 17:14:13 for IT++ by
Doxygen
1.8.1.2