casacore
StorageOption.h
Go to the documentation of this file.
1 //# StorageOption.h: Options defining how table files are organized
2 //# Copyright (C) 2014
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have receied a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id: StorageOption.h 20859 2010-02-03 13:14:15Z gervandiepen $
27 
28 #ifndef TABLES_STORAGEOPTION_H
29 #define TABLES_STORAGEOPTION_H
30 
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
34 
35 namespace casacore { //# NAMESPACE CASACORE - BEGIN
36 
37 // <summary>
38 // Options defining how table files are organized
39 // </summary>
40 
41 // <use visibility=export>
42 
43 // <reviewed reviewer="TPPR" date="08.11.94" tests="tTable.cc">
44 // </reviewed>
45 
46 // <synopsis>
47 // This class can be used to define how the files of a table are organized.
48 // There are two ways:
49 // <ol>
50 // <li> The old way where each storage manager has its own file(s).
51 // <li> Using MultiFile that storage managers can use to combine about all
52 // table files in a single file. This mode is particularly useful
53 // for new file systems (like Lustre) requiring large block sizes.
54 // <br>The block size to be used in a MultiFile can be defined in
55 // this class. Default is 4 MByte.
56 // <li> Using MultiHDF5 which behaves similar to MultiFile but uses an
57 // HDF5 file instead of a regular file.
58 // </ol>
59 // It is possible to specify the storage type and block size using aipsrc.
60 // The aipsrc variables are:
61 // <ul>
62 // <li> <src>table.storage.option</src>. The (case-insensitive) value can be
63 // 'multifile' or 'multihdf5'.
64 // Another value means the old way (separate files).
65 // <li> <src>table.storage.blocksize</src> gives the default blocksize to be
66 // used for the multifile and multihdf5 option.
67 // </ul>
68 // </synopsis>
69 
70 
72  {
73  public:
74  // Define the possible options how table files are organized.
75  enum Option {
76  // Let storage managers use a combined MultiFile.
78  // Let storage managers use a combined MultiHDF5.
80  // Let storage managers use separate files.
82  // Use default (currently MultiFile).
84  // Use as defined in the aipsrc file.
86  };
87 
88  // Create an option object.
89  // The parameter values are described in the synopsis.
90  // The blocksize has to be given in bytes.
91  // A size value -2 means reading that size from the aipsrc file.
92  // A size value -1 means use the default of 4*1024*1024.
94 
95  // Fill the option in case Aipsrc or Default was given.
96  // It is done as explained in the synopsis.
97  void fillOption();
98 
99  // Get the option.
100  Option option() const
101  { return itsOption; }
102 
103  // Set the option.
105  { itsOption = option; }
106 
107  // Get the block size (in bytes).
108  uInt blockSize() const
109  { return itsBlockSize; }
110 
111  // Set the block size (in bytes).
113  { itsBlockSize = blockSize; }
114 
115  private:
118  };
119 
120 } //# NAMESPACE CASACORE - END
121 
122 #endif
int Int
Definition: aipstype.h:50
Use default (currently MultiFile).
Definition: StorageOption.h:83
Let storage managers use separate files.
Definition: StorageOption.h:81
Let storage managers use a combined MultiHDF5.
Definition: StorageOption.h:79
Options defining how table files are organized.
Definition: StorageOption.h:71
Option option() const
Get the option.
void setBlockSize(Int blockSize)
Set the block size (in bytes).
StorageOption(Option option=Aipsrc, Int blockSize=-2)
Create an option object.
void setOption(Option option)
Set the option.
Option
Define the possible options how table files are organized.
Definition: StorageOption.h:75
uInt blockSize() const
Get the block size (in bytes).
Let storage managers use a combined MultiFile.
Definition: StorageOption.h:77
Class to read the casa general resource files.
Definition: Aipsrc.h:218
this file contains all the compiler specific defines
Definition: mainpage.dox:28
void fillOption()
Fill the option in case Aipsrc or Default was given.
unsigned int uInt
Definition: aipstype.h:51