00001 00029 #ifndef FRONT_DROP_QUEUE_H 00030 #define FRONT_DROP_QUEUE_H 00031 00032 #include <itpp/protocol/packet.h> 00033 #include <itpp/protocol/events.h> 00034 00035 00036 namespace itpp 00037 { 00038 00040 00041 00043 #define DEFAULT_MAX_BYTES_IN_QUEUE 24000 00044 00046 class Front_Drop_Queue : public virtual std::queue<Packet*> 00047 { 00048 public: 00050 Front_Drop_Queue(const int max_bytes = DEFAULT_MAX_BYTES_IN_QUEUE) { 00051 max_bytes_in_queue = max_bytes; 00052 bytes_in_queue = 0; 00053 debug = false; 00054 } 00055 00056 // TODO destructor 00057 // ~FrontDropQueue() { } 00058 00060 void set_debug(const bool enable_debug = true) { 00061 debug = enable_debug; 00062 } 00063 00065 void push(Packet *packet); 00067 void pop(); 00068 00070 void set_max_byte_size(int max_bytes) { max_bytes_in_queue = max_bytes; } 00072 int max_byte_size() { return max_bytes_in_queue; } 00074 int byte_size() { return bytes_in_queue; } 00075 00076 private: 00077 int max_bytes_in_queue; 00078 int bytes_in_queue; 00079 int debug; 00080 }; 00081 00083 00084 } // namespace itpp 00085 00086 #endif // #ifndef FRONT_DROP_QUEUE_H 00087
Generated on Wed Jul 27 2011 16:27:05 for IT++ by Doxygen 1.7.4