casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DataManInfo.h
Go to the documentation of this file.
1 //# DataManInfo.h: Class with static functions to manipulate a datamanager info record
2 //# Copyright (C) 2001,2002,2003,2009
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 received 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$
27 
28 #ifndef TABLES_DATAMANINFO_H
29 #define TABLES_DATAMANINFO_H
30 
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
35 
36 namespace casacore { //# NAMESPACE CASACORE - BEGIN
37 
38 //# Forward Declarations.
39 class TableDesc;
40 class Table;
41 class Record;
42 
43 
44 // <summary>
45 // Class with static functions to manipulate a datamanager record.
46 // </summary>
47 
48 // <use visibility=export>
49 
50 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tTableCopy.cc">
51 // </reviewed>
52 
53 // <prerequisite>
54 //# Classes you should understand before using this one.
55 // <li> Table
56 // </prerequisite>
57 
58 // <synopsis>
59 // DataManInfo is a class to manipulate a datamanager info record and table
60 // descriptions.
61 // Often an existing table description and datamanager info record is used to
62 // construct a new table, but it might be necessary to change it somewhat.
63 // <ul>
64 // <li> Remove hypercolumn definitions from a table description. They are
65 // not needed anymore and can be a burden.
66 // <li> Replace non-writable storage managers (like LofarStMan) by a
67 // writable one.
68 // <li> Replace the deprecated TiledDataStMan by TiledShapeStMan.
69 // </ul>
70 //
71 // Such things might be necessary in a number
72 // </synopsis>
73 
74 //# <todo asof="$DATE:$">
75 //# </todo>
76 
77 
79 {
80 public:
81  // Remove hypercolumn definitions from the table description.
82  static void removeHypercolumns (TableDesc& tabDesc);
83 
84  // Replace TiledDataStMan by TiledShapeStMan in the DataManagerInfo record.
85  // Since TiledShapeStMan does not support ID columns, they are
86  // adjusted as well in tabDesc and dminfo.
87  static void adjustTSM (TableDesc& tabDesc, Record& dminfo);
88 
89  // Replace non-writable storage managers by the given storage manager
90  // (usually StandardStMan or IncrementalStMan).
91  // It is possible to specify the new data manager type to use.
92  // This is needed for special storage managers like LofarStMan.
93  // If replaceMSM is set, MemoryStMan is also replaced.
94  static Record adjustStMan (const Record& dminfo, const String& dmType,
95  Bool replaceMSM = True);
96 
97  // Set the data managers of the given column(s) to the given tiled storage
98  // manager (normally TiledShapeStMan or TiledColumnStMan).
99  // The columns are combined in a single storage manager, so the function
100  // has to be called multiple times if, say, one per column is needed.
101  // The columns already having a tiled storage manager are not changed.
102  static void setTiledStMan (Record& dminfo, const Vector<String>& columns,
103  const String& dmType, const String& dmName,
104  const IPosition& defaultTileShape);
105 
106  // Remove the columns from the dminfo record and return a vector with the
107  // names of the columns actually removed.
108  // The columns having a data manager matching <src>keepType</src> are not
109  // removed. Matching means that the beginning of the data manager name
110  // have to match, so "Tiled" matches all tiled storagemanagers.
111  static Vector<String> removeDminfoColumns (Record& dminfo,
112  const Vector<String>& columns,
113  const String& keepType= String());
114 
115  // Adjust the data manager types and groups and the
116  // hypercolumn definitions to the actual data manager info.
117  static void adjustDesc (TableDesc& tabDesc, const Record& dminfo);
118 
119  // Show the Table IO statistics.
120  static void showDataManStats (const Table&, ostream&);
121 };
122 
123 
124 
125 } //# NAMESPACE CASACORE - END
126 
127 #endif
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
A 1-D Specialization of the Array class.
static void adjustDesc(TableDesc &tabDesc, const Record &dminfo)
Adjust the data manager types and groups and the hypercolumn definitions to the actual data manager i...
Main interface class to a read/write table.
Definition: Table.h:153
static void removeHypercolumns(TableDesc &tabDesc)
Remove hypercolumn definitions from the table description.
static Record adjustStMan(const Record &dminfo, const String &dmType, Bool replaceMSM=True)
Replace non-writable storage managers by the given storage manager (usually StandardStMan or Incremen...
static void setTiledStMan(Record &dminfo, const Vector< String > &columns, const String &dmType, const String &dmName, const IPosition &defaultTileShape)
Set the data managers of the given column(s) to the given tiled storage manager (normally TiledShapeS...
static Vector< String > removeDminfoColumns(Record &dminfo, const Vector< String > &columns, const String &keepType=String())
Remove the columns from the dminfo record and return a vector with the names of the columns actually ...
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
static void showDataManStats(const Table &, ostream &)
Show the Table IO statistics.
static void adjustTSM(TableDesc &tabDesc, Record &dminfo)
Replace TiledDataStMan by TiledShapeStMan in the DataManagerInfo record.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
Define the structure of a Casacore table.
Definition: TableDesc.h:187
Class with static functions to manipulate a datamanager record.
Definition: DataManInfo.h:78
const Bool True
Definition: aipstype.h:43
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42