// file: example.h // // make sure definitions are only made once // #ifndef ISIP_EXAMPLE #define ISIP_EXAMPLE // system include files // #include #include #include #include // Example: a class that does nothing. // class Example { //--------------------------------------------------------------------------- // // public constants // //--------------------------------------------------------------------------- public: // define the class name // static const char* CLASS_NAME; // define algorithm choices // enum ALGORITHM { EX_APPLE = 0, EX_ORANGE, EX_BANANA }; //---------------------------------------- // // other important constants // //---------------------------------------- // define an initial value for CRC // float EX_JOE; //---------------------------------------- // // default values and arguments // //---------------------------------------- // define the default value(s) of the class data // // default arguments to methods // //---------------------------------------- // // error codes // //---------------------------------------- static const long ERR = 1600; static const long ERR_IO = 1601; //--------------------------------------------------------------------------- // // protected data // //--------------------------------------------------------------------------- protected: // this section contains data common to all algorithms // // declare a register to hold the current checksum // float sum_d; // declare a static debug level for all class instantiations // static long debug_level_d; // this section contains data for a specific algorithm // //--------------------------------------------------------------------------- // // required public methods // //--------------------------------------------------------------------------- public: float assign(float val) { sum_d = val; } // method: name // static const char* name() { return CLASS_NAME; } // method: setDebug // bool setDebug(long level) { debug_level_d = level; return true; } // other constructor(s) // Example() { sum_d = 0.0; } // method: destructor // ~Example() {}; // method: copy constructor // Example(const Example& arg) { sum_d = arg.sum_d; } // method: debug // long debug(FILE* arg); //--------------------------------------------------------------------------- // // private methods // //--------------------------------------------------------------------------- private: // zero-out data in an algorithm dependent manner // bool reset() { sum_d = 0; return true; } }; // end of include file // #endif