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

📄 timesortedsched.hh

📁 COPE the first practical network coding scheme which is developped on click
💻 HH
字号:
// -*- mode: c++; c-basic-offset: 4 -*-#ifndef CLICK_TIMESORTEDSCHED_HH#define CLICK_TIMESORTEDSCHED_HH#include <click/element.hh>#include <click/notifier.hh>CLICK_DECLS/*=cTimeSortedSched(I<KEYWORDS>)=s analysismerge sorted packet streams by timestamp=ioOne output, zero or more inputs=dTimeSortedSched responds to pull requests by returning the chronologicallynext packet pulled from its inputs, determined by packet timestamps.TimeSortedSched listens for notification from its inputs to avoid uselesspulls, and provides notification for its output.Keyword arguments are:=over 8=item STOPBoolean. If true, stop the driver when there are no packets available (and theupstream notifiers indicate that no packets will become available soon).Default is false.=back=nTimeSortedSched is a notifier signal, active iff any of the upstream notifiersare active.=eThis example merges multiple tcpdump(1) files into a single, time-sortedstream, and stops the driver when all the files are exhausted.  tss :: TimeSortedSched(STOP true);  FromDump(FILE1) -> [0] tss;  FromDump(FILE2) -> [1] tss;  FromDump(FILE3) -> [2] tss;  // ...  tss -> ...;=aFromDump*/class TimeSortedSched : public Element, public PassiveNotifier { public:    // NB: Notifier cannot be Active, or we would have rescheduling conflicts.    // Example:    // 1. We are unscheduled and off.    // 2. Upstream Notifier wakes up, reschedules downstream puller.    // 3. Downstream puller Task runs, calls our pull() function.    // 4. We wake up, call wake_notifiers().    // 5. That eventually calls downstream puller Task's fast_reschedule()!!    // 6. We return to downstream puller's run_task().    // 7. Downstream puller's run_task() calls fast_reschedule()!! Crash.    // Principle: Do not call ActiveNotifier::wake_listeners() on a call    // from downstream listeners.    TimeSortedSched();    ~TimeSortedSched();    const char *class_name() const	{ return "TimeSortedSched"; }    const char *processing() const	{ return PULL; }    void *cast(const char *);    void notify_ninputs(int);    int configure(Vector<String> &, ErrorHandler *);    int initialize(ErrorHandler *);    void cleanup(CleanupStage);    Packet *pull(int);    // from Notifier    SearchOp notifier_search_op();      private:    Packet **_vec;    NotifierSignal *_signals;    bool _stop;    };CLICK_ENDDECLS#endif

⌨️ 快捷键说明

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