📄 scheduleinfo.hh
字号:
// -*- c-basic-offset: 4; related-file-name: "../../../elements/standard/scheduleinfo.cc" -*-#ifndef CLICK_SCHEDULEINFO_HH#define CLICK_SCHEDULEINFO_HH#include <click/element.hh>CLICK_DECLS/*=cScheduleInfo(ELEMENT PARAM, ...)=s informationspecifies scheduling parameters=ioNone=dProvides scheduling parameters for specified elements. Each configurationargument has the form `ELEMENT PARAM', meaning that the elementnamed ELEMENT has scheduling parameter PARAM. Schedulingparameters are real numbers that set how often one element should bescheduled in relation to another. For example,if elements A and B havescheduling parameters 2 and 0.5, respectively, then A will be scheduled2/0.5 = 4 times as often as B. The default scheduling parameter is 1.ScheduleInfo elements inside a compound element can specify schedulingparameters for that compound's components.Outer ScheduleInfo elementscan specify a ``scheduling parameter'' for the compoundelement as a whole. This ``scheduling parameter'' is really a scalingfactor affecting the compound's components. For example, consider thisconfiguration, elementclass Compound { i :: InfiniteSource -> output; ScheduleInfo(i 0.5); } c :: Compound -> Discard; ScheduleInfo(c 4);which is the same as the following configuration, after compound elementsare expanded. c/i :: InfiniteSource -> Discard@3 :: Discard; c/ScheduleInfo@2 :: ScheduleInfo(i 0.5); ScheduleInfo@4 :: ScheduleInfo(c 4);The name of the first ScheduleInfo element starts with `c/', so it isused to look up scheduling parameters for elements named `c/I<whatever>'.V<>(This includes all components of the compound element `c'.) The second ScheduleInfo element, however, has no slash in its name,so it is used to look up all scheduling parameters,including scaling factors for compound elements.The InfiniteSource's final scaling parameter will be 2:the scaling factor 4 times the local scheduling parameter 0.5.An outer ScheduleInfo element can override local scheduling parameters.For example, if the second ScheduleInfo element above was ScheduleInfo@4 :: ScheduleInfo(c 4, c/i 10.5)then the InfiniteSource's final scaling parameter would be 10.5.*/class ScheduleInfo : public Element { public: enum { FRAC_BITS = 10 }; ScheduleInfo(); ~ScheduleInfo(); const char* class_name() const { return "ScheduleInfo"; } int configure_phase() const { return CONFIGURE_PHASE_INFO; } int configure(Vector<String>&, ErrorHandler*); bool query(const String&, int&) const; bool query_prefixes(const String&, int&, String&) const; static int query(Element*, ErrorHandler*); static void initialize_task(Element*, Task*, bool sched, ErrorHandler*); static void initialize_task(Element*, Task*, ErrorHandler*); static void join_scheduler(Element*, Task*, ErrorHandler*);};inline voidScheduleInfo::initialize_task(Element* e, Task* t, ErrorHandler* errh){ initialize_task(e, t, true, errh);}inline voidScheduleInfo::join_scheduler(Element* e, Task* t, ErrorHandler* errh){ initialize_task(e, t, true, errh);}CLICK_ENDDECLS#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -