front_drop_queue.h
Go to the documentation of this file.
#ifndef FRONT_DROP_QUEUE_H
#define FRONT_DROP_QUEUE_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/packet.h>
#include <itpp/protocol/events.h>
namespace itpp
{
#define DEFAULT_MAX_BYTES_IN_QUEUE 24000
class Front_Drop_Queue : public virtual std::queue<Packet*>
{
public:
Front_Drop_Queue(const int max_bytes = DEFAULT_MAX_BYTES_IN_QUEUE) {
max_bytes_in_queue = max_bytes;
bytes_in_queue = 0;
debug = false;
}
// TODO destructor
// ~FrontDropQueue() { }
void set_debug(const bool enable_debug = true) {
debug = enable_debug;
}
void push(Packet *packet);
void pop();
void set_max_byte_size(int max_bytes) { max_bytes_in_queue = max_bytes; }
int max_byte_size() { return max_bytes_in_queue; }
int byte_size() { return bytes_in_queue; }
private:
int max_bytes_in_queue;
int bytes_in_queue;
int debug;
};
} // namespace itpp
#endif
#endif // #ifndef FRONT_DROP_QUEUE_H
itpp::Front_Drop_Queue::byte_size
int byte_size()
ADD DOCUMENTATION HERE.
Definition: front_drop_queue.h:84
itpp::Packet
Definition: packet.h:55
itpp::Front_Drop_Queue::push
void push(Packet *packet)
ADD DOCUMENTATION HERE.
Definition: front_drop_queue.cpp:35
itpp::Front_Drop_Queue
ADD DOCUMENTATION HERE.
Definition: front_drop_queue.h:56
itpp::Front_Drop_Queue::max_byte_size
int max_byte_size()
ADD DOCUMENTATION HERE.
Definition: front_drop_queue.h:82
itpp::Front_Drop_Queue::set_debug
void set_debug(const bool enable_debug=true)
ADD DOCUMENTATION HERE.
Definition: front_drop_queue.h:70
itpp::Front_Drop_Queue::pop
void pop()
ADD DOCUMENTATION HERE.
Definition: front_drop_queue.cpp:66
events.h
Definitions of an event-based simulation class.
DEFAULT_MAX_BYTES_IN_QUEUE
#define DEFAULT_MAX_BYTES_IN_QUEUE
ADD DOCUMENTATION HERE.
Definition: front_drop_queue.h:53
itpp
itpp namespace
Definition: itmex.h:36
packet.h
Definition of a Packet class.
itpp::Front_Drop_Queue::set_max_byte_size
void set_max_byte_size(int max_bytes)
ADD DOCUMENTATION HERE.
Definition: front_drop_queue.h:80
itpp::Front_Drop_Queue::Front_Drop_Queue
Front_Drop_Queue(const int max_bytes=DEFAULT_MAX_BYTES_IN_QUEUE)
ADD DOCUMENTATION HERE.
Definition: front_drop_queue.h:60

Generated on Thu Aug 20 2015 21:02:51 for IT++ by Doxygen 1.8.9.1