00001 // ===================================================================== 00002 // $Id: TModule.hh,v 1.1.1.1 2003/06/27 02:56:41 goiwai Exp $ 00003 // $Name: CLDAQ-1-06-00 $ 00004 // ===================================================================== 00005 #ifndef __TMODULE_HH 00006 #define __TMODULE_HH 00007 00008 #include "Tglobals.h" 00009 00010 class TDataSegment; 00011 class TDataElement; 00012 00013 class TModule 00014 { 00015 00016 public: 00017 enum { tStatusSuccess = 0 }; 00018 00019 protected: 00020 Tint theNumberOfChannels; 00021 Tint theStatus; 00022 00023 public: 00024 TModule( Tint nchannel = 0 ); 00025 TModule( const TModule& right ); 00026 virtual ~TModule(); 00027 00028 public: 00029 virtual Tint Clear() = 0; 00030 virtual Tint Update() = 0; 00031 virtual Tint Initialize() = 0; 00032 virtual Tvoid FillData( TDataElement& element, Tint channel ) = 0; 00033 00034 public: 00035 virtual const TModule& operator=( const TModule& right ); 00036 virtual Tbool operator==( const TModule& right ) const; 00037 virtual Tbool operator!=( const TModule& right ) const; 00038 00039 public: 00040 Tint GetNumberOfChannels() const; 00041 Tint GetStatus() const; 00042 Tvoid SetNumberOfChannels( Tint nchannel ); 00043 Tvoid SetStatus( Tint status ); 00044 Tbool IsSuccess() const; 00045 00046 }; 00047 00048 inline Tint TModule::GetNumberOfChannels() const 00049 { 00050 return( theNumberOfChannels ); 00051 } 00052 00053 inline Tvoid TModule::SetNumberOfChannels( Tint nchannel ) 00054 { 00055 theNumberOfChannels = nchannel; 00056 return; 00057 } 00058 00059 inline Tint TModule::GetStatus() const 00060 { 00061 return( theStatus ); 00062 } 00063 00064 inline Tvoid TModule::SetStatus( Tint status ) 00065 { 00066 theStatus = status; 00067 return; 00068 } 00069 00070 inline Tbool TModule::IsSuccess() const 00071 { 00072 return( ( theStatus >= 0 ) ? Ttrue : Tfalse ); 00073 } 00074 00075 #endif