Generic hardware access library
/home/cschwick/hal/generic/include/hal/AddressTable.hh
Go to the documentation of this file.
00001 #ifndef __AddressTable
00002 #define __AddressTable
00003 
00004 #include <ext/hash_map>
00005 #include <string>
00006 
00007 #include "hal/AddressTableInterface.hh"
00008 #include "hal/AddressTableItem.hh"
00009 #include "hal/NoSuchItemException.hh"
00010 #include "hal/IllegalOperationException.hh"
00011 #include "hal/HalHash.hh"
00012 #include "hal/MaskBoundaryException.hh"
00013 #include "VMEConstants.h"
00014 
00015 namespace HAL {
00016 
00049 class AddressTable : public AddressTableInterface {
00050 public:
00066   AddressTable( const AddressTable& orgiginal );
00069   virtual ~AddressTable();
00072   std::string getName() const { return name; } ;
00075   const GeneralHardwareAddress& getGeneralHardwareAddress( std::string item ) const
00076     throw( NoSuchItemException );
00079   const GeneralHardwareAddress& getWritableHardwareAddress( std::string item ) const
00080     throw (NoSuchItemException, IllegalOperationException);
00083   const GeneralHardwareAddress& getReadableHardwareAddress( std::string item ) const
00084     throw (NoSuchItemException, IllegalOperationException);
00087   const AddressTableItem& checkItem(std::string item) const 
00088     throw (NoSuchItemException);
00091   bool isReadable( std::string item ) const
00092     throw( NoSuchItemException );
00095   bool isWritable( std::string item ) const
00096     throw( NoSuchItemException );
00099   bool exists( std::string item ) const;
00102   uint32_t getMask( std::string item ) const
00103     throw( NoSuchItemException );
00106   std::string getDescription( std::string item ) const
00107     throw( NoSuchItemException );
00110   bool isBit( std::string item ) const
00111     throw( NoSuchItemException );
00114   __gnu_cxx::hash_map<std::string, AddressTableItem*, HalHash<std::string> >::const_iterator
00115   getItemListBegin() const; 
00116 
00119   __gnu_cxx::hash_map<std::string, AddressTableItem*, HalHash<std::string> >::const_iterator
00120   getItemListEnd() const; 
00121   
00124   uint32_t applyToMask( std::string item, 
00125                              uint32_t data, 
00126                              bool MaskBoundaryCheck = true ) const
00127     throw( NoSuchItemException, MaskBoundaryException );
00130   uint32_t applyFromMask( std::string item, 
00131                                uint32_t data, 
00132                                bool MaskBoundaryCheck = false ) const
00133     throw( NoSuchItemException, MaskBoundaryException );
00134 
00135 protected:
00142   AddressTable( std::string name );
00143 
00144 protected:
00145   __gnu_cxx::hash_map<std::string, AddressTableItem*, HalHash<std::string> > itemMap;
00146   std::string name;
00147 };
00148 
00149 } /* namespace HAL */
00150 
00151 #endif /*__AddressTable */
00152