Generic hardware access library
/home/cschwick/hal/generic/include/hal/PCIAddressTable.hh
Go to the documentation of this file.
00001 #ifndef __PCIAddressTable
00002 #define __PCIAddressTable
00003 
00004 #include <vector>
00005 #include <string>
00006 #include <iostream>
00007 
00008 #include "hal/IllegalOperationException.hh"
00009 #include "hal/AddressTable.hh"
00010 #include "hal/AddressTableReader.hh"
00011 #include "hal/PCIHardwareAddress.hh"
00012 #include "hal/AddressSpace.hh"
00013 #include "hal/AddressOutOfLimitsException.hh"
00014 
00015 
00016 namespace HAL {
00017 
00047 class PCIAddressTable : public AddressTable {
00048 
00049 public :
00050 
00057   PCIAddressTable( std::string name, AddressTableReader& tableReader );
00058 
00059   virtual ~PCIAddressTable();
00060 
00071   void getAddressBoundaries( uint32_t& minConfigAddress,
00072                              uint32_t& maxConfigAddress,
00073                              std::vector<uint32_t>& minAddresses,
00074                              std::vector<uint32_t>& maxAddresses ) const;
00075   
00079   void checkAddressLimits( std::string item, uint32_t offset ) const
00080     throw( NoSuchItemException,
00081            AddressOutOfLimitsException );
00082 
00086   void checkAddressLimits( const GeneralHardwareAddress& hardwareAddress,
00087                            uint32_t offset ) const
00088     throw( AddressOutOfLimitsException );  
00089   
00093   void print( std::ostream& os = std::cout ) const;
00094 
00095 private :
00096   void determineAddressBoundaries();
00097   std::vector< uint32_t > maxAddresses_;
00098   std::vector< uint32_t > minAddresses_;
00099   uint32_t minConfigAddress_;
00100   uint32_t maxConfigAddress_;
00101 };
00102 
00103 } /* namespace HAL */
00104 
00105 #endif /* __PCIAddressTable */