00001 // ===================================================================== 00024 // ===================================================================== 00025 #ifndef CLDAQ__TMODULE_HH 00026 #define CLDAQ__TMODULE_HH 00027 00028 #include "Tglobals.h" 00029 00030 class TDataSegment; 00031 class TDataElement; 00032 00033 00053 class TModule 00054 { 00055 00056 public: 00057 enum { tStatusSuccess = 0 }; 00058 00059 protected: 00060 Tint theNumberOfChannels; 00061 Tint theStatus; 00062 00063 public: 00064 TModule( Tint nchannel = 0 ); 00065 TModule( const TModule& right ); 00066 virtual ~TModule(); 00067 00068 public: 00069 virtual Tint Clear() = 0; 00070 virtual Tint Update() = 0; 00071 virtual Tint Initialize() = 0; 00072 virtual Tvoid FillData( TDataElement& element, Tint channel ) = 0; 00073 00074 public: 00075 virtual const TModule& operator=( const TModule& right ); 00076 virtual Tbool operator==( const TModule& right ) const; 00077 virtual Tbool operator!=( const TModule& right ) const; 00078 00079 public: 00080 Tint GetNumberOfChannels() const; 00081 Tint GetStatus() const; 00082 Tvoid SetNumberOfChannels( Tint nchannel ); 00083 Tvoid SetStatus( Tint status ); 00084 Tbool IsSuccess() const; 00085 00086 }; 00087 00088 inline Tint TModule::GetNumberOfChannels() const 00089 { 00090 return theNumberOfChannels; 00091 } 00092 00093 inline Tvoid TModule::SetNumberOfChannels( Tint nchannel ) 00094 { 00095 theNumberOfChannels = nchannel; 00096 return; 00097 } 00098 00099 inline Tint TModule::GetStatus() const 00100 { 00101 return theStatus; 00102 } 00103 00104 inline Tvoid TModule::SetStatus( Tint status ) 00105 { 00106 theStatus = status; 00107 return; 00108 } 00109 00110 inline Tbool TModule::IsSuccess() const 00111 { 00112 return ( theStatus >= 0 ) ? Ttrue : Tfalse; 00113 } 00114 00115 #endif