casacore
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>
34 #include <casacore/casa/Arrays/Vector.h>
35 
36 namespace casacore { //# NAMESPACE CASACORE - BEGIN
37 
38 //# Forward Declarations.
39 class TableDesc;
40 class Record;
41 
42 
43 // <summary>
44 // Class with static functions to manipulate a datamanager record.
45 // </summary>
46 
47 // <use visibility=export>
48 
49 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tTableCopy.cc">
50 // </reviewed>
51 
52 // <prerequisite>
53 //# Classes you should understand before using this one.
54 // <li> Table
55 // </prerequisite>
56 
57 // <synopsis>
58 // DataManInfo is a class to manipulate a datamanager info record and table
59 // descriptions.
60 // Often an existing table description and datamanager info record is used to
61 // construct a new table, but it might be necessary to change it somewhat.
62 // <ul>
63 // <li> Remove hypercolumn definitions from a table description. They are
64 // not needed anymore and can be a burden.
65 // <li> Replace non-writable storage managers (like LofarStMan) by a
66 // writable one.
67 // <li> Replace the deprecated TiledDataStMan by TiledShapeStMan.
68 // </ul>
69 //
70 // Such things might be necessary in a number
71 // </synopsis>
72 
73 //# <todo asof="$DATE:$">
74 //# </todo>
75 
76 
78 {
79 public:
80  // Remove hypercolumn definitions from the table description.
81  static void removeHypercolumns (TableDesc& tabDesc);
82 
83  // Replace TiledDataStMan by TiledShapeStMan in the DataManagerInfo record.
84  // Since TiledShapeStMan does not support ID columns, they are
85  // adjusted as well in tabDesc and dminfo.
86  static void adjustTSM (TableDesc& tabDesc, Record& dminfo);
87 
88  // Replace non-writable storage managers by the given storage manager
89  // (usually StandardStMan or IncrementalStMan).
90  // It is possible to specify the new data manager type to use.
91  // This is needed for special storage managers like LofarStMan.
92  // If replaceMSM is set, MemoryStMan is also replaced.
93  static Record adjustStMan (const Record& dminfo, const String& dmType,
94  Bool replaceMSM = True);
95 
96  // Set the data managers of the given column(s) to the given tiled storage
97  // manager (normally TiledShapeStMan or TiledColumnStMan).
98  // The columns are combined in a single storage manager, so the function
99  // has to be called multiple times if, say, one per column is needed.
100  // The columns already having a tiled storage manager are not changed.
101  static void setTiledStMan (Record& dminfo, const Vector<String>& columns,
102  const String& dmType, const String& dmName,
103  const IPosition& defaultTileShape);
104 
105  // Remove the columns from the dminfo record and return a vector with the
106  // names of the columns actually removed.
107  // The columns having a data manager matching <src>keepType</src> are not
108  // removed. Matching means that the beginning of the data manager name
109  // have to match, so "Tiled" matches all tiled storagemanagers.
110  static Vector<String> removeDminfoColumns (Record& dminfo,
111  const Vector<String>& columns,
112  const String& keepType= String());
113 
114  // Adjust the data manager types and groups and the
115  // hypercolumn definitions to the actual data manager info.
116  static void adjustDesc (TableDesc& tabDesc, const Record& dminfo);
117 };
118 
119 
120 
121 } //# NAMESPACE CASACORE - END
122 
123 #endif
A Vector of integers, for indexing into Array<T> objects.
Definition: IPosition.h:119
A 1-D Specialization of the Array class.
Definition: ArrayIO.h:45
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...
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 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:186
Class with static functions to manipulate a datamanager record.
Definition: DataManInfo.h:77
const Bool True
Definition: aipstype.h:43
this file contains all the compiler specific defines
Definition: mainpage.dox:28