a scalar math class that implements a Boolean variable (basic); | |
a vector math class that implements a vector using C++'s template capability (intermediate); | |
a data structure class that implements a doubly linked list using templates (intermediate); | |
an algorithm that computers Autocorrelation coefficients (advanced). |
// make sure definitions are only made once // #ifndef ISIP_BOOLEAN #define ISIP_BOOLEAN |
// end of include file // #endif |
boolean setSdb(Sdb& arg); boolean apply(VectorFloat& x, VectorFloat& y); boolean assign(CircularBuffer& cb); |
// forward class declaration // class Sdb; template<class TObject> class GraphVertex; |
// Boolean: a binary logical value (logical true or logical false) // class Boolean { //--------------------------------------------- // // public constants // //--------------------------------------------- public: //--------------------------------------------- // // protected data // //--------------------------------------------- protected: //--------------------------------------------- // // required public methods // //--------------------------------------------- public: //--------------------------------------------- // // class-specific public methods // //--------------------------------------------- public: //--------------------------------------------- // // private methods // //--------------------------------------------- private: }; |
// VectorByte: a vector of Byte objects // class VectorByte : public MVector<Byte, byte> { |
template<class TScalar, class TIntegral> class MVector { |
// Float: a class that manages a 32-bit float. this class mainly // inherits the MScalar template functionality. we only need to add Sof file // support and memory management // class Float : public MScalar<float, float32> { |
// VectorFloat: a vector of Float objects // class VectorFloat : public MVector<Float, float> { |
// MScalar: the scalar template class which is inherited by other // scalar classes. // template<class TIntegral, class TSize> class MScalar { |
boolean eq(TIntegral arg1, TIntegral arg2) const; boolean almostEqual(TIntegral arg, double significant_exponent) const; |
MScalar<long, int32> myLong; |
class Autocorrelation : public AlgorithmBase { ... public: static const String CLASS_NAME; enum ALGORITHM { FACTORED = 0, UNFACTORED }; static const NameMap ALGO_MAP; static const long DEF_ORDER = -1; ... protected: ALGORITHM algorithm_d; Long order_d; static MemoryManager mgr_d; ... public: static const String& name(); static boolean diagnose(Integral::DEBUG debug_level); boolean debug(const unichar* msg) const; ... boolean setAlgorithm(ALGORITHM algorithm); boolean setOrder(long order); ... private: boolean computeFromData(VectorFloat& output, const VectorFloat& input); boolean computeUnfactored(VectorFloat& output, const VectorFloat& input); boolean computeFactored(VectorFloat& output, const VectorFloat& input); ... |
static const String CLASS_NAME; enum ALGORITHM { FACTORED = 0, UNFACTORED, DEF_ALG = FACTORED }; static const NameMap ALGO_MAP; static const long DEF_ORDER = -1; |
enum ALGORITHM { FACTORED = 0, UNFACTORED, DEF_ALG = FACTORED }; |
Autocorrelation::ALGORITHM alg_cor = Autocorrelation::FACTORED; Autocorrelation::ALGORITHM alg_incor = 5; |
Autocorrelation(long order = DEF_ORDER); |
Autocorrelation autoc; |
boolean advance(long increment = DEF_INCREMENT); boolean advanceAndAssign(const TObject& input, long increment = DEF_INCREMENT); |
boolean debug(const unichar* msg) const; long sofSize() const; boolean write(Sof& sof_a, long tag_a) const; boolean writeData(Sof& sof, const String& pname) const; |
static long exit(); static boolean sleep(long sleep_seconds); static double floor(double arg); |
Integral::exit(); |