00001 // ===================================================================== 00002 // $Id: TVmeModule.hh,v 1.1.1.1 2003/06/27 02:56:41 goiwai Exp $ 00003 // $Name: CLDAQ-1-06-00 $ 00004 // ===================================================================== 00005 #ifndef __TVMEMODULE_HH 00006 #define __TVMEMODULE_HH 00007 00008 #include "Tglobals.h" 00009 #include "TModule.hh" 00010 00011 class TVmeModule 00012 : public TModule 00013 { 00014 00015 protected: 00016 Tsize_t theMappedSize; 00017 TvmeTransfer_t theTransferMode; 00018 Tint theFileDescriptor; 00019 Tcaddr_t theBaseAddress; 00020 Toff_t theOffsetAddress; 00021 00022 public: 00023 TVmeModule( Tint nch, Toff_t offset, Tint mapsize, TvmeTransfer_t mode ); 00024 TVmeModule( const TVmeModule& right ); 00025 00026 protected: 00027 virtual ~TVmeModule(); 00028 00029 public: 00030 virtual const TVmeModule& operator=( const TVmeModule& right ); 00031 virtual Tbool operator==( const TVmeModule& right ) const; 00032 virtual Tbool operator!=( const TVmeModule& right ) const; 00033 00034 public: 00035 Tsize_t GetMappedSize() const; 00036 TvmeTransfer_t GetTransferMode() const; 00037 Tint GetFileDescriptor() const; 00038 Tcaddr_t GetBaseAddress() const; 00039 Toff_t GetOffsetAddress() const; 00040 Tvoid SetMappedSize( Tsize_t mapsize ); 00041 Tvoid SetTransferMode( TvmeTransfer_t mode ); 00042 Tvoid SetFileDescriptor( Tint fd ); 00043 Tvoid SetBaseAddress( Tcaddr_t address ); 00044 Tvoid SetOffsetAddress( Toff_t offset ); 00045 00046 protected: 00047 Tvoid showBit( TUshort data, const Tstring comment = "" ) const; 00048 Tvoid setBit( TUshort* ptr, Tint nbit, Tbit bit ); 00049 Tbit getBit( TUshort* ptr, Tint nbit ) const; 00050 00051 }; 00052 00053 inline Tsize_t TVmeModule::GetMappedSize() const 00054 { 00055 return( theMappedSize ); 00056 } 00057 00058 inline TvmeTransfer_t TVmeModule::GetTransferMode() const 00059 { 00060 return( theTransferMode ); 00061 } 00062 00063 inline Tint TVmeModule::GetFileDescriptor() const 00064 { 00065 return( theFileDescriptor ); 00066 } 00067 00068 inline Tcaddr_t TVmeModule::GetBaseAddress() const 00069 { 00070 return( theBaseAddress ); 00071 } 00072 00073 inline Toff_t TVmeModule::GetOffsetAddress() const 00074 { 00075 return( theOffsetAddress ); 00076 } 00077 00078 inline Tvoid TVmeModule::SetMappedSize( Tsize_t mapsize ) 00079 { 00080 theMappedSize = mapsize; 00081 return; 00082 } 00083 00084 inline Tvoid TVmeModule::SetTransferMode( TvmeTransfer_t mode ) 00085 { 00086 theTransferMode = mode; 00087 return; 00088 } 00089 00090 inline Tvoid TVmeModule::SetFileDescriptor( Tint fd ) 00091 { 00092 theFileDescriptor = fd; 00093 return; 00094 } 00095 00096 inline Tvoid TVmeModule::SetBaseAddress( Tcaddr_t address ) 00097 { 00098 theBaseAddress = address; 00099 return; 00100 } 00101 00102 inline Tvoid TVmeModule::SetOffsetAddress( Toff_t offset ) 00103 { 00104 theOffsetAddress = offset; 00105 return; 00106 } 00107 00108 #endif