//# OS.h: Classes for operating system services, and assorted other things //# Copyright (C) 1995,1996,1998,1999,2001,2002 //# Associated Universities, Inc. Washington DC, USA. //# //# This library is free software; you can redistribute it and/or modify it //# under the terms of the GNU Library General Public License as published by //# the Free Software Foundation; either version 2 of the License, or (at your //# option) any later version. //# //# This library is distributed in the hope that it will be useful, but WITHOUT //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public //# License for more details. //# //# You should have received a copy of the GNU Library General Public License //# along with this library; if not, write to the Free Software Foundation, //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. //# //# Correspondence concerning AIPS++ should be addressed as follows: //# Internet email: aips2-request@nrao.edu. //# Postal address: AIPS++ Project Office //# National Radio Astronomy Observatory //# 520 Edgemont Road //# Charlottesville, VA 22903-2475 USA //# //# $Id$ #ifndef CASA_OS_H #define CASA_OS_H //# Includes #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace casacore { //# NAMESPACE CASACORE - BEGIN // // // // Classes for operating system services, and assorted other things // // //
  • Nothing special // // // // // // 'OS' is the standard abbreviation for 'Operating System'. // // // // This module's main purpose is to provide convenient and uniform // access to operating system features: environment variables, file // and directory access, time and date services, and uniform data // representation (which solves the variety of ways the fundamental // data types are represented in hardware). //

    // The following functionality is available: //

      //
    • Class // EnvironmentVariable // for access to environment variables. //
    • Class Path, // RegularFile, // SymLink, and // Directory // for dealing with the file system. // Note that module IO deals with // reading and writing data to files and other IO streams. //
    • Class Time // to get the system time. //
    • Class Timer // to measure elapsed, user, and system time of a piece of code. //
    • Framework Conversion // to convert data from one format to another. There are // classes to convert to/from // canonical // format, // VAX format, and // IBM/360 format. // The structure of the framework is shown in the // OMT diagram. //
    • A class to encapsulate Memory usage. // Class MemoryTrace makes it possible to trace all memory (de)allocations // through malloc and free (new and delete). // It only works on Linux systems though. //
    //
    // // See the various class header files. // // // // We want to provide a simple and uniform interface to OS services and // features for the application and library programmer. To pick a few // examples: //
      //
    1. Recursive deletion of a directory. //
    2. Access to time and date information. //
    3. Get and set environment variables. //
    //
    // //
  • The OS module is a bit fuzzy: for example, canonical data // format conversion is more a matter of hardware than of operating // system differences. Perhaps these particular classes should be // moved to a new module. //
  • Time and Date classes should be revised after studying // similar classes designed by others. Roel Martinez is tenatively // scheduled to do this in the late summer of 1995. //
  • There was once some discussion of a 'VOS' (virtual operating system) // module. This seems like a good idea. Nested subdirectories for // specific operating systems would contain the implementations, but // a common interface would be used for all. And perhaps local // site makedefs could be used to select the proper implementation // to link against, with no special action required of the programmer. // // } //# NAMESPACE CASACORE - END #endif