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

📄 colorhashdiagnose.h

📁 这是一个从音频信号里提取特征参量的程序
💻 H
📖 第 1 页 / 共 2 页
字号:
// file: $isip/class/dstr/ColorHash/ColorHashDiagnose.h// version: $Id: ColorHashDiagnose.h,v 1.2 2000/12/26 17:01:59 picone Exp $//// make sure definitions are only made once//#ifndef ISIP_GVHASH_DIAGNOSE#define ISIP_GVHASH_DIAGNOSE// isip include files//#ifndef ISIP_GVHASH#include "ColorHash.h"#endif// ColorHashDiagnose: a class that contains the diagnose method of ColorHash class.//template<class TObject>class ColorHashDiagnose : public ColorHash<TObject> {  //---------------------------------------------------------------------------  //  // public constants  //  //---------------------------------------------------------------------------public:    // define the class name  //  //----------------------------------------  //  // i/o related constants  //  //----------------------------------------      //----------------------------------------  //  // default values and arguments  //  //----------------------------------------  // default values  //      // default arguments to methods  //    //----------------------------------------  //  // error codes  //  //----------------------------------------      //---------------------------------------------------------------------------  //  // protected data  //  //---------------------------------------------------------------------------protected:  //---------------------------------------------------------------------------  //  // required public methods  //  //---------------------------------------------------------------------------public:  // methods: name  //  static const String& name() {    return ColorHash<TObject>::name();  }  // other static methods  //  static boolean diagnose(Integral::DEBUG debug_level);  // debug methods  //  these methods are omitted since this class does not have data  //  members and operations    //    // destructor/constructor(s):  //  these methods are omitted since this class does not have data  //  members and operations  //  // assign methods:  //  these methods are omitted since this class does not have data  //  members and operations  //  // operator= methods:  //  these methods are omitted since this class does not have data  //  members and operations  //    // i/o methods:  //  these methods are omitted since this class does not have data  //  members and operations  //  // equality methods:  //  these methods are omitted since this class does not have data  //  members and operations  //  // memory-management methods:  //  these methods are omitted since this class does not have data  //  members and operations  //    //---------------------------------------------------------------------------  //  // class-specific public methods  //  //---------------------------------------------------------------------------  //  these methods are omitted since this class does not have data  //  members and operations  //    //---------------------------------------------------------------------------  //  // private methods  //  //---------------------------------------------------------------------------private:}; // below are all the methods for the ColorHashDiagnose template class////-----------------------------------------------------------------------------//// required static methods////-----------------------------------------------------------------------------// method: diagnose//// arguments://  Integral::DEBUG level: (input) debug level for diagnostics//// return: a boolean value indicating status//template<class TObject>boolean ColorHashDiagnose<TObject>::diagnose(Integral::DEBUG level_a) {      //---------------------------------------------------------------------------  //  // 0. preliminaries  //  //---------------------------------------------------------------------------  // output the class name  //  if (level_a > Integral::NONE) {    SysString output(L"diagnosing class ");    output.concat(name());    output.concat(L": ");    Console::put(output);    Console::increaseIndention();  }   //--------------------------------------------------------------------------  //  // 1. required public methods  //  //--------------------------------------------------------------------------  // set indentation  //  if (level_a > Integral::NONE) {    Console::put(L"testing required public methods...\n");    Console::increaseIndention();  }  // test the constructors  //  GraphVertex<Char> vert_00;  ColorHash<Char> hash_00;  hash_00.insert(&vert_00, Integral::BLACK);  ColorHash<Char> hash_01(hash_00);  if (hash_00.get(&vert_00) != Integral::BLACK) {    return Error::handle(name(), L"constructor", Error::TEST,			 __FILE__, __LINE__);      }  if (hash_01.get(&vert_00) != Integral::BLACK) {    return Error::handle(name(), L"constructor", Error::TEST,			 __FILE__, __LINE__);      }    if (hash_00.get(&vert_00) != hash_01.get(&vert_00)) {    return Error::handle(name(), L"constructor", Error::TEST,			 __FILE__, __LINE__);  }  // test assign methods  //  ColorHash<Char> hash_02;  hash_02.assign(hash_00);  if (hash_02.get(&vert_00) != Integral::BLACK) {    return Error::handle(name(), L"assign", Error::TEST,			 __FILE__, __LINE__);      }    // test operator= and equality methods  //  ColorHash<Char> hash_03;  hash_03 = hash_02;  if (level_a > Integral::BRIEF) {    hash_03.debug(L"hash_03");  }    if (!hash_03.eq(hash_00)) {    return Error::handle(name(), L"eq", Error::TEST,			 __FILE__, __LINE__);      }        // reset indentation  //  if (level_a > Integral::NONE) {    Console::decreaseIndention();  }  //--------------------------------------------------------------------------  //  // 2. hash table property methods  //  //--------------------------------------------------------------------------  // set indentation  //  if (level_a > Integral::NONE) {    Console::put(L"testing hash table property methods...\n");    Console::increaseIndention();  }  // create a hash table  //  ColorHash<Char> hash_04;  // test the isEmpty method  //  if (!hash_04.isEmpty()) {    return Error::handle(name(), L"isEmpty", Error::TEST,			 __FILE__, __LINE__);  }  // create some data  //  GraphVertex<Char> vert_01;  GraphVertex<Char> vert_02;  // add some vertices to the hash table  //  hash_04.insert(&vert_01, Integral::GREEN);  hash_04.insert(&vert_02, Integral::WHITE);  // test the getNumItems method  //  if (hash_04.getNumItems() != (long)2) {    return Error::handle(name(), L"getNumItems()", Error::TEST,			 __FILE__, __LINE__);          }  // test the isEmpty method  //  if (hash_04.isEmpty()) {    return Error::handle(name(), L"isEmpty", Error::TEST,			 __FILE__, __LINE__);  }    // reset indentation  //  if (level_a > Integral::NONE) {    Console::decreaseIndention();  }  //--------------------------------------------------------------------------  //  // 3. hash table get and set methods  //  //--------------------------------------------------------------------------  // set indentation  //

⌨️ 快捷键说明

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