Generic hardware access library
/home/cschwick/hal/generic/src/common/AddressTableReader.cc
Go to the documentation of this file.
00001 #include "hal/AddressTableReader.hh"
00002 
00003 HAL::AddressTableReader::AddressTableReader()
00004   : firstAccess( true ) {
00005 }
00006 
00007 HAL::AddressTableReader::~AddressTableReader() {
00008   // must delete everything which has not been yet "read out"
00009   // via the next method:
00010   if ( firstAccess ) it = itemPointerList.begin();
00011   while ( it != itemPointerList.end() ) {
00012     delete (*it);
00013     it++;
00014   }
00015 }
00016 
00017 bool HAL::AddressTableReader::next( HAL::AddressTableItem** nextItem ) {
00018   if ( firstAccess )  {
00019     it = itemPointerList.begin();;
00020     firstAccess = false;
00021   }
00022   if ( it != itemPointerList.end() ) {
00023     *nextItem = *it;
00024     it++;
00025     return true;
00026   } else {
00027     return false;
00028   }
00029 }