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

📄 qvec.hh

📁 COPE the first practical network coding scheme which is developped on click
💻 HH
字号:
// qvec.hh// Douglas S. J. De Couto// 5 March 2003// Poor man's queue#ifndef CLICK_QUEUE_HH#define CLICK_QUEUE_HH#include <click/vector.hh>CLICK_DECLStemplate <class T>class QVec : public Vector<T> {  typedef Vector<T> Base;public:  QVec() { }  explicit QVec(int capacity) : Base(capacity) { }  T &front() { return at(0); }    void push_front(const T &);  void pop_front();};template <class T> inline voidQVec<T>::push_front(const T &e){  int n = size();  if (n > 0)    push_back(back());  for (int i = 1; i < n; i++)    this->at(i) = this->at(i - 1);  this->at(0) = e;}template <class T> inline voidQVec<T>::pop_front(){  assert(size() > 0);  int n = size();  for (int i = 0; i < n - 1; i++)    this->at(i) = this->at(i + 1);  pop_back();}CLICK_ENDDECLS#endif

⌨️ 快捷键说明

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