📄 cb.h
字号:
// file: cb.h//// this file defines a circular buffer class//// make sure definitions are only made once//#ifndef __CB#define __CBclass Circular_buffer { //--------------------------------------------------------------------------- // // protected data // //---------------------------------------------------------------------------protected: // data information // int idx_d; int size_d; float *buf_d; //--------------------------------------------------------------------------- // // public methods // //---------------------------------------------------------------------------public: // constructors/destructors // Circular_buffer(); ~Circular_buffer(); // allocation // void allocate_cc(int num_elements); // indexing methods // int add_cc(float new_value); // overloaded operators // float operator() (int index); operator float() {return (float)buf_d[idx_d];} float& operator= (float value) { add_cc(value); return buf_d[idx_d]; } //--------------------------------------------------------------------------- // // private methods // //---------------------------------------------------------------------------private: // none};//// end of include file#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -