📄 etraits.hh
字号:
// -*- c-basic-offset: 4 -*-#ifndef CLICK_ETRAITS_HH#define CLICK_ETRAITS_HH#include <click/string.hh>struct Driver { enum { USERLEVEL = 0, LINUXMODULE = 1, BSDMODULE = 2, NSMODULE = 3, ALLMASK = 0xF, COUNT = 4 }; static const char *name(int); static const char *requirement(int); static int driver(const String&); static int driver_mask(const String&);}; struct ElementTraits { String name; String cxx; String documentation_name; String header_file; String source_file; String processing_code; String flow_code; String flags; String requirements; String provisions; int def_index; int driver_mask; int name_next; ElementTraits(); static const ElementTraits &null_traits() { return the_null_traits; } bool allows_driver(int d) const { return (driver_mask&(1<<d)) != 0; } bool requires(const String &) const; bool provides(const String &) const; int flag_value(int) const; String *component(int); String *component(const String &); void calculate_driver_mask(); enum { D_NONE, D_CLASS, D_CXX_CLASS, D_HEADER_FILE, D_PROCESSING, D_FLOW_CODE, D_FLAGS, D_REQUIREMENTS, D_PROVISIONS, D_SOURCE_FILE, D_DOC_NAME, D_FIRST_DEFAULT = D_CLASS, D_LAST_DEFAULT = D_PROVISIONS }; static int parse_component(const String &); static ElementTraits make(int, ...); private: static ElementTraits the_null_traits; friend class ElementMap; };typedef ElementTraits Traits;inlineElementTraits::ElementTraits() : def_index(0), driver_mask(Driver::ALLMASK), name_next(0){}inline String *ElementTraits::component(const String &s){ return component(parse_component(s));}#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -