Generic hardware access library
/home/cschwick/hal/generic/src/common/StaticVMEItem.cc
Go to the documentation of this file.
00001 #include "hal/StaticVMEItem.hh"
00002 #include <sstream>
00003 #include <iomanip>
00004 
00005 HAL::StaticVMEItem::StaticVMEItem(  std::string serialNumber,
00006                                     uint32_t slotId )
00007   throw( HAL::IllegalValueException ) 
00008   : serialNumber_(serialNumber),
00009     slotId_(slotId) {
00010   
00011   if ( slotId_ > MAX_NUMBER_OF_SLOTS ) {
00012     std::stringstream text;
00013     text <<  "Too large number of slots : " 
00014          << std::dec << slotId_ 
00015          << "  (max is " 
00016          << MAX_NUMBER_OF_SLOTS
00017          << ")\n    (HAL::StaticVMEItem::StaticVMEItem)" << std::ends;
00018     throw( HAL::IllegalValueException( text.str(), __FILE__, __LINE__, __FUNCTION__ ) );
00019   }
00020 }
00021 
00022 std::string HAL::StaticVMEItem::getSerialNumber() const {
00023   return serialNumber_;
00024 }
00025 
00026 uint32_t HAL::StaticVMEItem::getSlotId() const {
00027   return slotId_;
00028 }
00029