00001 /*<std-header orig-src='shore' incl-file-exclusion='DEVID_T_H'> 00002 00003 $Id: devid_t.h,v 1.22 2010/07/26 23:37:06 nhall Exp $ 00004 00005 SHORE -- Scalable Heterogeneous Object REpository 00006 00007 Copyright (c) 1994-99 Computer Sciences Department, University of 00008 Wisconsin -- Madison 00009 All Rights Reserved. 00010 00011 Permission to use, copy, modify and distribute this software and its 00012 documentation is hereby granted, provided that both the copyright 00013 notice and this permission notice appear in all copies of the 00014 software, derivative works or modified versions, and any portions 00015 thereof, and that both notices appear in supporting documentation. 00016 00017 THE AUTHORS AND THE COMPUTER SCIENCES DEPARTMENT OF THE UNIVERSITY 00018 OF WISCONSIN - MADISON ALLOW FREE USE OF THIS SOFTWARE IN ITS 00019 "AS IS" CONDITION, AND THEY DISCLAIM ANY LIABILITY OF ANY KIND 00020 FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 00021 00022 This software was developed with support by the Advanced Research 00023 Project Agency, ARPA order number 018 (formerly 8230), monitored by 00024 the U.S. Army Research Laboratory under contract DAAB07-91-C-Q518. 00025 Further funding for this work was provided by DARPA through 00026 Rome Research Laboratory Contract No. F30602-97-2-0247. 00027 00028 */ 00029 00030 #ifndef DEVID_T_H 00031 #define DEVID_T_H 00032 00033 #include "w_defines.h" 00034 00035 /* -- do not edit anything above this line -- </std-header>*/ 00036 00037 #ifdef __GNUG__ 00038 #pragma interface 00039 #endif 00040 00041 /**\brief Internal Device ID 00042 * 00043 * \ingroup IDS 00044 * 00045 * \details 00046 * This identifier is not persistent; it is assigned when 00047 * a device is mounted (by the filesystem's file name (a string)) 00048 */ 00049 struct devid_t { 00050 /* Use explicit w_base because int8 is confused with system 00051 int8 == 8 bits, not 8 bytes */ 00052 w_base_t::uint8_t id; 00053 w_base_t::uint4_t dev; 00054 #ifdef ZERO_INIT 00055 fill4 dummy; 00056 #endif 00057 00058 devid_t() : id(0), dev(0) {}; 00059 devid_t(const char* pathname); 00060 00061 bool operator==(const devid_t& d) const { 00062 return id == d.id && dev == d.dev; 00063 } 00064 00065 bool operator!=(const devid_t& d) const {return !(*this==d);} 00066 friend ostream& operator<<(ostream&, const devid_t& d); 00067 00068 static const devid_t null; 00069 }; 00070 00071 /*<std-footer incl-file-exclusion='DEVID_T_H'> -- do not edit anything below this line -- */ 00072 00073 #endif /*</std-footer>*/