Generic hardware access library
|
00001 #ifndef __GeneralHardwareAddress 00002 #define __GeneralHardwareAddress 00003 00004 #include <stdint.h> 00005 #include <vector> 00006 00007 #include "hal/AddressSpace.hh" 00008 #include "hal/IllegalOperationException.hh" 00009 00010 00011 namespace HAL { 00012 00035 class GeneralHardwareAddress { 00036 public: 00042 GeneralHardwareAddress ( uint32_t address, 00043 uint32_t dataWidth ); 00044 00045 virtual ~GeneralHardwareAddress(); 00046 00050 uint32_t getAddress() const; 00051 00060 uint32_t getComputedAddress( const std::vector<uint32_t>& baseaddresses ) const ; 00066 virtual uint32_t getAddressModifier() const 00067 throw( IllegalOperationException ) = 0; 00068 00072 uint32_t getDataWidth() const; 00073 00077 enum AddressSpace getAddressSpace() const; 00082 uint32_t getMapId() const; 00086 bool isConfigSpace() const; 00087 00091 bool isMemorySpace()const; 00092 00098 virtual bool isIOSpace() const 00099 throw( IllegalOperationException ) = 0; 00100 00104 virtual void print( std::ostream& os = std::cout ) const = 0; 00105 00109 virtual GeneralHardwareAddress* clone() const = 0; 00110 00111 protected: 00112 00113 uint32_t address_; 00114 uint32_t dataWidth_; 00115 uint32_t addressModifier_; 00116 00120 uint32_t mapId_; 00121 00126 enum AddressSpace addressSpace_; 00127 }; 00128 00129 } /* namespace HAL */ 00130 00131 #endif /* __GeneralHardwareAddress */