00001 //# OS.h: Classes for operating system services, and assorted other things 00002 //# Copyright (C) 1995,1996,1998,1999,2001,2002 00003 //# Associated Universities, Inc. Washington DC, USA. 00004 //# 00005 //# This library is free software; you can redistribute it and/or modify it 00006 //# under the terms of the GNU Library General Public License as published by 00007 //# the Free Software Foundation; either version 2 of the License, or (at your 00008 //# option) any later version. 00009 //# 00010 //# This library is distributed in the hope that it will be useful, but WITHOUT 00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00013 //# License for more details. 00014 //# 00015 //# You should have received a copy of the GNU Library General Public License 00016 //# along with this library; if not, write to the Free Software Foundation, 00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00018 //# 00019 //# Correspondence concerning AIPS++ should be addressed as follows: 00020 //# Internet email: aips2-request@nrao.edu. 00021 //# Postal address: AIPS++ Project Office 00022 //# National Radio Astronomy Observatory 00023 //# 520 Edgemont Road 00024 //# Charlottesville, VA 22903-2475 USA 00025 //# 00026 //# $Id$ 00027 00028 #ifndef CASA_OS_H 00029 #define CASA_OS_H 00030 00031 //# Includes 00032 #include <casacore/casa/aips.h> 00033 00034 #include <casacore/casa/OS/EnvVar.h> 00035 #include <casacore/casa/OS/Path.h> 00036 #include <casacore/casa/OS/RegularFile.h> 00037 #include <casacore/casa/OS/SymLink.h> 00038 #include <casacore/casa/OS/Directory.h> 00039 #include <casacore/casa/OS/DirectoryIterator.h> 00040 00041 #include <casacore/casa/OS/Time.h> 00042 #include <casacore/casa/OS/Timer.h> 00043 00044 #include <casacore/casa/OS/Conversion.h> 00045 #include <casacore/casa/OS/CanonicalConversion.h> 00046 #include <casacore/casa/OS/DataConversion.h> 00047 #include <casacore/casa/OS/CanonicalDataConversion.h> 00048 00049 #include <casacore/casa/OS/Memory.h> 00050 #include <casacore/casa/OS/MemoryTrace.h> 00051 00052 00053 namespace casacore { //# NAMESPACE CASACORE - BEGIN 00054 00055 // <module> 00056 // 00057 // <summary> 00058 // Classes for operating system services, and assorted other things 00059 // </summary> 00060 00061 // <prerequisite> 00062 // <li> Nothing special 00063 // </prerequisite> 00064 // 00065 00066 // <reviewed reviewer="Paul Shannon" date="1995/06/02/ demos=""> 00067 // </reviewed> 00068 00069 // <etymology> 00070 // 'OS' is the standard abbreviation for 'Operating System'. 00071 // </etymology> 00072 // 00073 // <synopsis> 00074 // This module's main purpose is to provide convenient and uniform 00075 // access to operating system features: environment variables, file 00076 // and directory access, time and date services, and uniform data 00077 // representation (which solves the variety of ways the fundamental 00078 // data types are represented in hardware). 00079 // <p> 00080 // The following functionality is available: 00081 // <ul> 00082 // <li> Class <linkto class=EnvironmentVariable:description> 00083 // EnvironmentVariable</linkto> 00084 // for access to environment variables. 00085 // <li> Class <linkto class=Path:description>Path</linkto>, 00086 // <linkto class=RegularFile:description>RegularFile</linkto>, 00087 // <linkto class=SymLink:description>SymLink</linkto>, and 00088 // <linkto class=Directory:description>Directory</linkto> 00089 // for dealing with the file system. 00090 // Note that module <linkto module=IO>IO</linkto> deals with 00091 // reading and writing data to files and other IO streams. 00092 // <li> Class <linkto class=Time:description>Time</linkto> 00093 // to get the system time. 00094 // <li> Class <linkto class=Timer:description>Timer</linkto> 00095 // to measure elapsed, user, and system time of a piece of code. 00096 // <li> Framework <linkto class=Conversion:description>Conversion</linkto> 00097 // to convert data from one format to another. There are 00098 // classes to convert to/from 00099 // <linkto class=CanonicalConversion:description>canonical</linkto> 00100 // format, 00101 // <linkto class=VAXConversion:description>VAX</linkto> format, and 00102 // <linkto class=IBMConversion:description>IBM/360</linkto> format. 00103 // The structure of the framework is shown in the 00104 // <a href="OS/OS_1.html">OMT diagram</a>. 00105 // <li> A class to encapsulate <linkto class=Memory>Memory</linkto> usage. 00106 // Class MemoryTrace makes it possible to trace all memory (de)allocations 00107 // through malloc and free (new and delete). 00108 // It only works on Linux systems though. 00109 // </ul> 00110 00111 // </synopsis> 00112 00113 // <example> 00114 // See the various class header files. 00115 // </example> 00116 // 00117 // <motivation> 00118 // We want to provide a simple and uniform interface to OS services and 00119 // features for the application and library programmer. To pick a few 00120 // examples: 00121 // <ol> 00122 // <li> Recursive deletion of a directory. 00123 // <li> Access to time and date information. 00124 // <li> Get and set environment variables. 00125 // </ol> 00126 // </motivation> 00127 00128 // <todo asof="1995/06/02"> 00129 // <li> The OS module is a bit fuzzy: for example, canonical data 00130 // format conversion is more a matter of hardware than of operating 00131 // system differences. Perhaps these particular classes should be 00132 // moved to a new module. 00133 // <li> Time and Date classes should be revised after studying 00134 // similar classes designed by others. Roel Martinez is tenatively 00135 // scheduled to do this in the late summer of 1995. 00136 // <li> There was once some discussion of a 'VOS' (virtual operating system) 00137 // module. This seems like a good idea. Nested subdirectories for 00138 // specific operating systems would contain the implementations, but 00139 // a common interface would be used for all. And perhaps local 00140 // site makedefs could be used to select the proper implementation 00141 // to link against, with no special action required of the programmer. 00142 // </todo> 00143 00144 // </module> 00145 00146 00147 } //# NAMESPACE CASACORE - END 00148 00149 #endif