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 // Created on Tue Mar 11 13:38:31 PST 1997 by heydon 00020 00021 // Last modified on Mon Aug 9 17:04:47 EDT 2004 by ken@xorian.net 00022 // modified on Tue Dec 16 00:39:16 PST 1997 by heydon 00023 00024 // GLNode.H -- defines a class like a "GraphLog::Node", but with fewer fields 00025 00026 #ifndef _GL_NODE_H 00027 #define _GL_NODE_H 00028 00029 #include <Basics.H> 00030 #include <FS.H> 00031 #include <CacheIndex.H> 00032 #include <Derived.H> 00033 #include <GraphLog.H> 00034 00035 class GLNode { 00036 public: 00037 GLNode() throw () { /* SKIP */ } 00038 /* Default constructor */ 00039 00040 GLNode(const GraphLog::Node &node) throw () 00041 : ci(node.ci), kids(node.kids), refs(node.refs) { /* SKIP */ } 00042 /* Initialize this node to contain the relevant values of "node". */ 00043 00044 GLNode(std::istream &ifs) throw (FS::Failure, FS::EndOfFile) { Read(ifs); } 00045 /* Initialize this node from the input stream "ifs". */ 00046 00047 GLNode(CacheEntry::Index ci, CacheEntry::Indices *kids, 00048 Derived::Indices *refs) throw () 00049 : ci(ci), kids(kids), refs(refs) { /*SKIP*/ } 00050 00051 // write/read 00052 void Write(std::ostream &ofs) const throw (FS::Failure); 00053 void Read(std::istream &ifs) throw (FS::Failure, FS::EndOfFile); 00054 00055 // fields 00056 CacheEntry::Index ci; // this node's index 00057 CacheEntry::Indices *kids; // child entries 00058 Derived::Indices *refs; // deriveds reachable from this entry 00059 }; 00060 00061 #endif // _GL_NODE_H