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::Array
General array class.
Definition array.h:105
itpp::Front_Drop_Queue
ADD DOCUMENTATION HERE.
Definition front_drop_queue.h:57
itpp::Front_Drop_Queue::pop
void pop()
ADD DOCUMENTATION HERE.
Definition front_drop_queue.cpp:66
itpp::Front_Drop_Queue::byte_size
int byte_size()
ADD DOCUMENTATION HERE.
Definition front_drop_queue.h:84
itpp::Front_Drop_Queue::push
void push(Packet *packet)
ADD DOCUMENTATION HERE.
Definition front_drop_queue.cpp:35
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
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::set_debug
void set_debug(const bool enable_debug=true)
ADD DOCUMENTATION HERE.
Definition front_drop_queue.h:70
itpp::Front_Drop_Queue::max_byte_size
int max_byte_size()
ADD DOCUMENTATION HERE.
Definition front_drop_queue.h:82
itpp::Packet
Definition packet.h:56
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:37
packet.h
Definition of a Packet class.

Generated on Mon Jun 10 2024 11:49:24 for IT++ by Doxygen 1.9.8