#ifndef _Brooks0254Card_ #define _Brooks0254Card_ #include #include #include #define _OPEN_THREADS #include #include #include #include #include using namespace std; #include "Brooks0254Module.hh" class Brooks0254BasePar; class Brooks0254ParID; class Brooks0254Chassis; //! Brooks0254Card class to contain information about the //! Brooks0254 card or channel state. It contains an STL map with //! addresses of all parameters belonging to this chassis. Its Sync() method //! should be called periodilcally to synchronize the parameters in //! the object of this class and the corresponding hardware module. //! This class inherits from Brooks0254Module class, therefore it //! contains the pointer to the serial port object. The parameter objects //! are created in the constructor of this class. class Brooks0254Card : virtual public Brooks0254Module { protected: //! Card number which this object corresponds to unsigned bcCardNum; //! Map of pointers to the parameters object map bcPar; public: //! Contrustor Brooks0254Card( Brooks0254Module& module, unsigned cardNum ); //! Copy Constructor Brooks0254Card( Brooks0254Card& card ) ; //! Destructor ~Brooks0254Card(); //! Copy operator Brooks0254Card& operator=( Brooks0254Card& card ) ; //! Function to synchronize the content of the card with the device void Sync( bool dir = 0 ); //! Check if the communication is OK. At this point no need to check //! it, the Sync function of the chassis checks it inline bool CommIsOK() { return true; } inline unsigned GetCardNum() { MtxLock scopeLock( bmMutex ); return bcCardNum; } //! Return the map with the pointers to the parameter objects inline map GetParMap() { MtxLock scopeLock( bmMutex ); return bcPar; } //! Return pointer to the parameter with parameter type parID Brooks0254BasePar* GetPar( Brooks0254ParID& parID ) ; inline unsigned SetCardNum( unsigned num ) { MtxLock scopeLock( bmMutex ); return (bcCardNum = num); } //! Set the map of the pointers to the parameter objects. inline map SetParMap( map par ) { MtxLock scopeLock( bmMutex ); return (bcPar = par); } }; #endif