00001 //# Copyright (C) 1998,1999,2000,2001,2003 00002 //# Associated Universities, Inc. Washington DC, USA. 00003 //# 00004 //# This program is free software; you can redistribute it and/or modify it 00005 //# under the terms of the GNU General Public License as published by the Free 00006 //# Software Foundation; either version 2 of the License, or (at your option) 00007 //# any later version. 00008 //# 00009 //# This program is distributed in the hope that it will be useful, but WITHOUT 00010 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00011 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 00012 //# more details. 00013 //# 00014 //# You should have received a copy of the GNU General Public License along 00015 //# with this program; if not, write to the Free Software Foundation, Inc., 00016 //# 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00017 //# 00018 //# Correspondence concerning AIPS++ should be addressed as follows: 00019 //# Internet email: aips2-request@nrao.edu. 00020 //# Postal address: AIPS++ Project Office 00021 //# National Radio Astronomy Observatory 00022 //# 520 Edgemont Road 00023 //# Charlottesville, VA 22903-2475 USA 00024 //# 00025 00026 #ifndef IMAGES_OUTPUTDESTINATIONCHECKER_H 00027 #define IMAGES_OUTPUTDESTINATIONCHECKER_H 00028 00029 #include <casa/aips.h> 00030 #include <casa/namespace.h> 00031 00032 #include <casa/BasicSL/String.h> 00033 00034 #include <casa/Logging/LogIO.h> 00035 00036 #include <vector> 00037 00038 namespace casa { 00039 00040 class OutputDestinationChecker { 00041 // <summary> 00042 // </summary> 00043 00044 // <reviewed reviewer="" date="" tests="" demos=""> 00045 // </reviewed> 00046 00047 // <prerequisite> 00048 // </prerequisite> 00049 00050 // <etymology> 00051 // </etymology> 00052 00053 // <synopsis> 00054 // </synopsis> 00055 00056 public: 00057 00058 // struct for checking output file writability 00059 struct OutputStruct { 00060 // label used for messages, eg "residual image", "estmates file" 00061 String label; 00062 // pointer to the output name 00063 String *outputFile; 00064 // is this file required to be written, or can the task continue if it cannot be? 00065 Bool required; 00066 // If a file by the same name already exists, will the task allow it to be overwritten? 00067 Bool replaceable; 00068 }; 00069 00070 OutputDestinationChecker(); 00071 00072 //Destructor 00073 ~OutputDestinationChecker(); 00074 00075 static void checkOutputs(std::vector<OutputStruct> *const output, LogIO& log); 00076 00077 static void checkOutput(OutputStruct& output, LogIO& log); 00078 00079 // Get the number of channels that have been selected. The process() method must 00080 // be called prior to calling this method or an exception is thrown. 00081 uInt nSelectedChannels() const; 00082 00083 }; 00084 00085 } 00086 00087 #endif /* IMAGES_IMAGEINPUTPROCESSOR_H */