⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 notifierqueue.hh

📁 COPE the first practical network coding scheme which is developped on click
💻 HH
字号:
// -*- c-basic-offset: 4 -*-#ifndef CLICK_NOTIFIERQUEUE_HH#define CLICK_NOTIFIERQUEUE_HH#include <click/element.hh>#include <click/notifier.hh>#include "simplequeue.hh"#if NOTIFIERQUEUE_LOCK# include <click/sync.hh>#endifCLICK_DECLS/*=cNotifierQueueNotifierQueue(CAPACITY)=s storagestores packets in a FIFO queue=dStores incoming packets in a first-in-first-out queue.Drops incoming packets if the queue already holds CAPACITY packets.The default for CAPACITY is 1000.NotifierQueue notifies interested parties when it becomes empty and when aformerly-empty queue receives a packet. The empty notification takes placesome time after the queue goes empty, to prevent thrashing for queues thathover around 1 or 2 packets long. In all other respects, NotifierQueue behaveslike SimpleQueue.=nThe Queue element acts like NotifierQueue, but additionally notifiesinterested parties when it changes state from nonfull to full or vice versa.=h length read-onlyReturns the current number of packets in the queue.=h highwater_length read-onlyReturns the maximum number of packets that have ever been in the queue at once.=h capacity read/writeReturns or sets the queue's capacity.=h drops read-onlyReturns the number of packets dropped by the queue so far.=h reset_counts write-onlyWhen written, resets the C<drops> and C<highwater_length> counters.=h reset write-onlyWhen written, drops all packets in the queue.=a Queue, SimpleQueue, MixedQueue, FrontDropQueue */class NotifierQueue : public SimpleQueue { public:    NotifierQueue();    ~NotifierQueue();    const char *class_name() const		{ return "NotifierQueue"; }    void *cast(const char *);    int configure(Vector<String> &conf, ErrorHandler *);        void push(int port, Packet *);    Packet *pull(int port);#if NOTIFIERQUEUE_DEBUG    void add_handlers();#endif   protected:    enum { SLEEPINESS_TRIGGER = 9 };    int _sleepiness;#if NOTIFIERQUEUE_LOCK    Spinlock _lock;#endif    ActiveNotifier _empty_note;    friend class MixedQueue;    friend class InOrderQueue;    friend class ECNQueue;    friend class TokenQueue;#if NOTIFIERQUEUE_DEBUG    static String read_handler(Element *, void *);#endif    };CLICK_ENDDECLS#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -