Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

VLeaf.H

Go to the documentation of this file.
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 //
00020 // VLeaf.H
00021 // Last modified on Mon Sep 19 09:27:52 EDT 2005 by ken@xorian.net
00022 //      modified on Tue Aug  7 17:44:14 PDT 2001 by mann
00023 //
00024 // Derived class for in-memory representation of Vesta sources of
00025 // type immutableFile, ghost, and stub. 
00026 //
00027 // Objects of this class are used only transiently, most often as
00028 // results from VestaSource::lookup.  Most of the sources that exist
00029 // at any moment will not have objects of this class corresponding to
00030 // them; they will be stored in memory only in the representation of
00031 // their parent directories.
00032 //
00033 
00034 
00035 #ifndef _VLEAF
00036 #define _VLEAF 1
00037 
00038 #include "VestaSource.H"
00039 
00040 class VLeaf : public VestaSource {
00041   private:
00042     ShortId shortId_;
00043     unsigned int link_count;
00044   public:
00045     VestaSource::errorCode
00046       read(void* buffer, /*INOUT*/int* nbytes, Basics::uint64 offset,
00047            AccessControl::Identity who) throw ();
00048     bool executable() throw ();
00049     Basics::uint64 size() throw ();
00050     time_t timestamp() throw ();
00051     VestaSource::errorCode
00052       write(const void* buffer, /*INOUT*/int* nbytes, Basics::uint64 offset,
00053             AccessControl::Identity who) throw ();
00054     VestaSource::errorCode
00055       setExecutable(bool x, AccessControl::Identity who) throw ();
00056     VestaSource::errorCode
00057       setSize(Basics::uint64 s, AccessControl::Identity who) throw ();
00058     VestaSource::errorCode
00059       setTimestamp(time_t ts,AccessControl::Identity who) throw ();
00060     ShortId shortId() throw() { return shortId_; };
00061     VLeaf(VestaSource::typeTag type, ShortId shortId,
00062           unsigned int links = 1) throw() {
00063         shortId_ = shortId;
00064         link_count = links;
00065         VestaSource::type = type;
00066         VestaSource::attribs = NULL;
00067     };
00068     unsigned int linkCount() { return link_count; }
00069 };
00070 
00071 #endif // _VLEAF

Generated on Mon May 8 00:48:53 2006 for Vesta by  doxygen 1.4.2