00001 // Copyright (C) 2001, Compaq Computer Corporation 00002 // 00003 // This file is part of Vesta. 00004 // 00005 // Vesta is free software; you can redistribute it and/or 00006 // modify it under the terms of the GNU Lesser General Public 00007 // License as published by the Free Software Foundation; either 00008 // version 2.1 of the License, or (at your option) any later version. 00009 // 00010 // Vesta is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 // Lesser General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public 00016 // License along with Vesta; if not, write to the Free Software 00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 00019 // Last modified on Thu Aug 5 00:02:06 EDT 2004 by ken@xorian.net 00020 // modified on Sun Aug 30 22:56:44 PDT 1998 by heydon 00021 00022 /* Records an interval of cache indices that should be added or removed from 00023 the set of cache indices currently in use. */ 00024 00025 #ifndef _INTVL_H 00026 #define _INTVL_H 00027 00028 #include <Basics.H> 00029 #include <VestaLog.H> 00030 #include <Recovery.H> 00031 #include "CacheEntry.H" 00032 00033 // the closed interval "[lo, hi]" 00034 namespace Intvl 00035 { 00036 // type for indicating 00037 enum Op { Remove, Add }; 00038 00039 class T { 00040 public: 00041 Intvl::Op op; 00042 CacheEntry::Index lo, hi; 00043 T() throw () { /*SKIP*/ } 00044 T(RecoveryReader &rd) throw (VestaLog::Error, VestaLog::Eof) 00045 { Recover(rd); } 00046 00047 // log/recover 00048 void Log(VestaLog &log) const throw (VestaLog::Error); 00049 void Recover(RecoveryReader &rd) 00050 throw (VestaLog::Error, VestaLog::Eof); 00051 00052 // print 00053 void Debug(std::ostream &s) const throw (); 00054 00055 private: 00056 // hide copy constructor 00057 T(const T &); 00058 }; 00059 00060 class List { 00061 public: 00062 Intvl::List *next; 00063 Intvl::T i; 00064 List() throw () { /*SKIP*/ } 00065 private: 00066 // hide copy constructor 00067 List(const List &); 00068 }; 00069 } 00070 00071 #endif // _INTVL_H