StorageOption.h

Go to the documentation of this file.
00001 //# StorageOption.h: Options defining how table files are organized
00002 //# Copyright (C) 2014
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 receied 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: StorageOption.h 20859 2010-02-03 13:14:15Z gervandiepen $
00027 
00028 #ifndef TABLES_STORAGEOPTION_H
00029 #define TABLES_STORAGEOPTION_H
00030 
00031 
00032 //# Includes
00033 #include <casacore/casa/aips.h>
00034 
00035 namespace casacore { //# NAMESPACE CASACORE - BEGIN
00036 
00037 // <summary>
00038 // Options defining how table files are organized
00039 // </summary>
00040 
00041 // <use visibility=export>
00042 
00043 // <reviewed reviewer="TPPR" date="08.11.94" tests="tTable.cc">
00044 // </reviewed>
00045 
00046 // <synopsis>
00047 // This class can be used to define how the files of a table are organized.
00048 // There are two ways:
00049 // <ol>
00050 //  <li> The old way where each storage manager has its own file(s).
00051 //  <li> Using MultiFile that storage managers can use to combine about all
00052 //       table files in a single file. This mode is particularly useful
00053 //       for new file systems (like Lustre) requiring large block sizes.
00054 //       <br>The block size to be used in a MultiFile can be defined in
00055 //           this class. Default is 4 MByte.
00056 //  <li> Using MultiHDF5 which behaves similar to MultiFile but uses an
00057 //       HDF5 file instead of a regular file.
00058 // </ol>
00059 // It is possible to specify the storage type and block size using aipsrc.
00060 // The aipsrc variables are:
00061 // <ul>
00062 //  <li> <src>tables.storage.type</src>. The (case-insensitive) value can be
00063 //       'multifile' or 'multihdf5'.
00064 //       Another value means the old way (separate files).
00065 //  <li> <src>tables.storage.blocksize</src> gives the default blocksize to be
00066 //       used for the multifile and multihdf5 option.
00067 // </ul>
00068 // </synopsis>
00069 
00070 
00071   class StorageOption
00072   {
00073   public:
00074     // Define the possible options how table files are organized.
00075     enum Option {
00076       // Let storage managers use a combined MultiFile.
00077       MultiFile,
00078       // Let storage managers use a combined MultiHDF5.
00079       MultiHDF5,
00080       // Let storage managers use separate files.
00081       SepFile,
00082       // Use default (currently MultiFile).
00083       Default,
00084       // Use as defined in the aipsrc file.
00085       Aipsrc
00086     };
00087 
00088     // Create an option object.
00089     // The parameter values are described in the synopsis.
00090     // A size value -2 means reading that size from the aipsrc file.
00091     StorageOption (Option option=Aipsrc, Int blockSize=-2);
00092 
00093     // Fill the option in case Aipsrc or Default was given.
00094     // It is done as explained in the synopsis.
00095     void fillOption();
00096 
00097     // Get the option.
00098     Option option() const
00099       { return itsOption; }
00100 
00101     // Set the option.
00102     void setOption (Option option)
00103       { itsOption = option; }
00104 
00105     // Get the block size.
00106     uInt blockSize() const
00107       { return itsBlockSize; }
00108 
00109     // Set the block size.
00110     void setBlockSize (Int blockSize)
00111       { itsBlockSize = blockSize; }
00112 
00113   private:
00114     Option itsOption;
00115     Int    itsBlockSize;
00116   };
00117 
00118 } //# NAMESPACE CASACORE - END
00119 
00120 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1