circularbuffer.h

来自「这是处理语音信号的程序」· C头文件 代码 · 共 91 行

H
91 行
字号
// file: cb.h//// this file defines a circular buffer class//// make sure definitions are only made once//#ifndef __CB#define __CB// isip include files//#ifndef __ISIP_INTEGRAL#include <integral.h>#endifclass Circular_buffer {  //---------------------------------------------------------------------------  //  // protected data  //  //---------------------------------------------------------------------------protected:  // data information  //  int* idx_d;  int* num_d;  int size_d;  int dim_d;  float_8** buf_d;  //---------------------------------------------------------------------------  //  // public methods  //  //---------------------------------------------------------------------------public:  // constructors/destructors  //  Circular_buffer();  Circular_buffer(int dim, int num_elements);  ~Circular_buffer();  // debug  //  void debug();    // allocation  //  void allocate_cc(int dim, int num_elements);  // indexing methods  //  int add_cc(int dim, float_8 new_value);  void write_cc(int dim, int index, float_8 value);    void sub_cc(int dim) {    if (--num_d[dim] < 0)      num_d[dim] = 0;  }  void empty_cc();  // overloaded operators  //  float_8 operator() (int dim, int index);  // get mothods  //  int get_size_cc(int dim) {    return num_d[dim];  }  //---------------------------------------------------------------------------  //  // private methods  //  //---------------------------------------------------------------------------private:  // none};//// end of include file#endif

⌨️ 快捷键说明

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