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

📄 historypool.h

📁 这是一个从音频信号里提取特征参量的程序
💻 H
字号:
// file: $isip/class/search/HistoryPool/HistoryPool.h//// make sure definitions are only made once//#ifndef ISIP_HISTORY_POOL#define ISIP_HISTORY_POOL// isip include files//#ifndef ISIP_HISTORY#include <History.h>#endif#ifndef ISIP_CONTEXT#include <Context.h>#endif#ifndef ISIP_HASH_TABLE#include <HashTable.h>#endif// HistoryPool: A class to store and manage a pool of histories//class HistoryPool {  //---------------------------------------------------------------------------  //  // public constants  //  //---------------------------------------------------------------------------public:  // define the class name  //  static const String CLASS_NAME;  //----------------------------------------  //  // i/o related constants  //  //----------------------------------------    static const String DEF_PARAM;  //----------------------------------------  //  // other important constants  //  //----------------------------------------      //----------------------------------------  //  // default values and arguments  //  //----------------------------------------    // default values  //  static const long DEF_CAPACITY = 20000;    //---------------------------------------  //  // error codes  //  //---------------------------------------    //---------------------------------------------------------------------------  //  // protected data  //  //---------------------------------------------------------------------------protected:    // define the history pool  //  HashTable<History, History> pool_d;    // define a static debug level  //  static Integral::DEBUG debug_level_d;    // define a static memory manager  //  static MemoryManager mgr_d;  //---------------------------------------------------------------------------  //  // required public methods  //  //---------------------------------------------------------------------------public:  // method: name  //  static const String& name() {    return CLASS_NAME;  }  // method: diagnose  //  static boolean diagnose(Integral::DEBUG debug_level);  // method: debug  //  boolean debug(const unichar* message) const;  // method: setDebug  //  static boolean setDebug(Integral::DEBUG debug_level) {    debug_level_d = debug_level;    return true;  }    // method: destructor  //  ~HistoryPool() {    if (debug_level_d >= Integral::ALL) {           fprintf(stdout, "Destructor of history_pool: %p\n", this);      fflush(stdout);    }    // free allocated memory    //    clear();  }  // constructor(s)  //  HistoryPool();  HistoryPool(const HistoryPool& copy_node);    // assign methods  //  boolean assign(const HistoryPool& copy_node);  // method: sofSize  //  long sofSize() const {    return Error::handle(name(), L"sofSize", Error::ARG, __FILE__, __LINE__);  }    // method: read  //  boolean read(Sof& sof, long tag, const String& cname = CLASS_NAME) {    return Error::handle(name(), L"read", Error::ARG, __FILE__, __LINE__);  }  // method: write  //  boolean write(Sof& sof, long tag, const String& cname = CLASS_NAME) const {    return Error::handle(name(), L"write", Error::ARG, __FILE__, __LINE__);  }  // method: readData  //  boolean readData(Sof& sof, const String& pname = DEF_PARAM,		   long size = SofParser::FULL_OBJECT, boolean param = true,                   boolean nested = false) {    return Error::handle(name(), L"readData", Error::ARG, __FILE__, __LINE__);  }  // method: writeData  //  boolean writeData(Sof& sof, const String& pname = DEF_PARAM) const {    return Error::handle(name(), L"writeData", Error::ARG, __FILE__, __LINE__);  }  // equality method  //  boolean eq(const HistoryPool& compare_node) const;    // method: new  //  static void* operator new(size_t size) {    return mgr_d.get();  }  // method: new[]  //  static void* operator new[](size_t size) {    return mgr_d.getBlock(size);  }  // method: delete  //  static void operator delete(void* ptr) {    mgr_d.release(ptr);  }  // method: delete[]  //  static void operator delete[](void* ptr) {    mgr_d.releaseBlock(ptr);  }  // method: setGrowSize  //  static boolean setGrowSize(long grow_size) {    return mgr_d.setGrow(grow_size);  }  // clear methods  //  boolean clear(Integral::CMODE ctype = Integral::DEF_CMODE);  //---------------------------------------------------------------------------  //  // class-specific public methods  //  //---------------------------------------------------------------------------  // method: length  //  long length() const {    return pool_d.getNumItems();  }    // allocate methods  //  History* initAndAllocate();      History* popAndAllocate(History* obj, Context*& val);  History* pushAndAllocate(History* obj, Context* val);      //---------------------------------------------------------------------------  //  // private methods  //  //---------------------------------------------------------------------------private:};// end of include file//#endif

⌨️ 快捷键说明

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