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

📄 storage.hh

📁 COPE the first practical network coding scheme which is developped on click
💻 HH
字号:
// -*- c-basic-offset: 4 -*-#ifndef CLICK_STORAGE_HH#define CLICK_STORAGE_HHCLICK_DECLSclass Storage { public:    Storage()				: _head(0), _tail(0) { }    operator bool() const		{ return _head != _tail; }    bool empty() const			{ return _head == _tail; }    int size() const;    int capacity() const		{ return _capacity; }    int head() const			{ return _head; }    int tail() const			{ return _tail; }        int next_i(int i) const		{ return (i!=_capacity ? i+1 : 0); }    int prev_i(int i) const		{ return (i!=0 ? i-1 : _capacity); }    // to be used with care    void set_capacity(int c)		{ _capacity = c; }    void set_head(int h)		{ _head = h; }    void set_tail(int t)		{ _tail = t; }    protected:    int _capacity;    int _head;    int _tail;  };inline intStorage::size() const{    register int x = _tail - _head;    return (x >= 0 ? x : _capacity + x + 1);}CLICK_ENDDECLS#endif

⌨️ 快捷键说明

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