// // BROOKS PARAMETER BASE CLASS // Software Library for Linux // // // Purpose: base class for Brooks0254 MFC control paraeters // Date: Apri 28, 2011 // Author: Hovanes Egiyan // // // #ifndef _Brooks0254BasePar_ #define _Brooks0254BasePar_ #include #include #include #include #define _OPEN_THREADS #include #include #include #include #include #include "Brooks0254ParID.hh" #include "Brooks0254Module.hh" #include "Brooks0254Port.hh" // Base class for Brooks0254 parameters. The real parameter of // Brooks0254 are expected to inherit from this object. // All functions of this class lock the object and unlock when // complete. IT also should Unlock and Lock when sending the object // pointer as a fucntion parameter to avoid race conditions between // threads. The mutex data members for this class are inherited from // the Brooks0254Module. class Brooks0254BasePar : virtual public Brooks0254Module { protected: Brooks0254ParID bbpID; //! Paramter ID //! Substitute the comas by white space character static string RemoveComas( string& inStr ); //! Extract the leftmost decimal digit static int StripVal( int val ); public: //! Decimal point for the double static short bbpDecPoint; //! Constructor Brooks0254BasePar( Brooks0254Module& module, Brooks0254ParID parID ); //! Copy constructor Brooks0254BasePar( Brooks0254BasePar& par ); //! Destructor ~Brooks0254BasePar(); //! Copy operator Brooks0254BasePar& operator=( Brooks0254BasePar& par ); //! Return parameter ID inline Brooks0254ParID GetType() { MtxLock localLock( bmMutex ); return bbpID; } //! Change the ID of parameter. inline Brooks0254ParID SetType( const Brooks0254ParID& parID ) { MtxLock localLock( bmMutex ); return( bbpID = parID ); } }; #endif