casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TiledDataStManAccessor.h
Go to the documentation of this file.
1 //# TiledDataStManAccessor.h: Gives access to some TiledDataStMan functions
2 //# Copyright (C) 1994,1995,1996,1997,1999
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_TILEDDATASTMANACCESSOR_H
29 #define TABLES_TILEDDATASTMANACCESSOR_H
30 
31 //# Includes
32 #include <casacore/casa/aips.h>
34 
35 namespace casacore { //# NAMESPACE CASACORE - BEGIN
36 
37 //# Forward Declarations
38 class TiledDataStMan;
39 class Table;
40 class String;
41 class IPosition;
42 class Record;
43 
44 
45 // <summary>
46 // Give access to some TiledDataStMan functions
47 // </summary>
48 
49 // <use visibility=export>
50 
51 // <reviewed reviewer="Gareth Hunt" date="94Nov17" tests="">
52 // </reviewed>
53 
54 // <prerequisite>
55 //# Classes you should understand before using this one.
56 // <li> <linkto class=ROTiledStManAccessor>ROTiledStManAccessor</linkto>
57 // <li> <linkto class=TiledDataStMan>TiledDataStMan</linkto>
58 // </prerequisite>
59 
60 // <synopsis>
61 // The Table system has one or more storage managers underneath.
62 // These storage managers are invisible and there is no way to
63 // get access to them.
64 // However, the <linkto class=TiledDataStMan>TiledDataStMan</linkto>
65 // storage manager is quite specific. It has a few functions which
66 // need to be called by the user, in particular the functions
67 // defining and extending a hypercube.
68 // <p>
69 // The class TiledDataStManAccessor gives the user the means to
70 // access a TiledDataStMan object and to call the functions mentioned above.
71 // It can only be constructed for a table opened for read/write (because
72 // the functions in it need write access).
73 // </synopsis>
74 
75 // <motivation>
76 // In principle a pointer to TiledDataStMan could be used.
77 // However, that would give access to all public functions.
78 // Furthermore it could not distinguish between read/write and readonly
79 // tables.
80 // </motivation>
81 
82 // <example>
83 // <srcblock>
84 // // Open a table for write.
85 // Table table ("someName", Table::Update);
86 // // Get access to the tiled data storage manager with name UVdata.
87 // TiledDataStManAccessor accessor (Table, "UVdata");
88 // // Add a hypercube to it (requires addition of rows).
89 // // Define the values of the ID and coordinate columns.
90 // // (The coordinate vectors have to be filled in one way or another).
91 // Vector<double> timeVector(70);
92 // Vector<double> baselineVector(60);
93 // Vector<double> freqVector(50);
94 // Vector<double> polVector(4);
95 // Record values;
96 // values.define ("ID", 4); // ID=4
97 // values.define ("time", timeVector);
98 // values.define ("baseline", baselineVector);
99 // values.define ("freq", freqVector);
100 // values.define ("pol", polVector);
101 // table.addRow (4200);
102 // accessor.addHypercube (IPosition(4,4,50,60,70), // cube shape
103 // IPosition(4,4,5,6,7), // tile shape
104 // values); // id/coord values
105 // </srcblock>
106 // </example>
107 
108 // <todo asof="$DATE:$">
109 //# A List of bugs, limitations, extensions or planned refinements.
110 // <li> A base class RO_Tiled(Data)StManAccessor may once be needed
111 // for access to a tiled data storage manager in a readonly table
112 // </todo>
113 
114 
115 
117 {
118 public:
119 
120  // Construct the object for the data manager in the table.
121  // An exception is thrown if the data manager type does not
122  // match the type of this TiledDataStManAccessor object.
123  // Also an exception is thrown if the table is not open for read/write.
124  TiledDataStManAccessor (const Table& table, const String& dataManagerName);
126 
128 
129  // Copy constructor (reference semantics).
131 
132  // Assignment (reference semantics).
134 
135  // Add a hypercube.
136  // The possible coordinate- and id-values have to be given in the
137  // record (where the field names should be equal to the
138  // coordinate and id column names).
139  void addHypercube (const IPosition& cubeShape,
140  const IPosition& tileShape,
141  const Record& values);
142 
143  // Extend the hypercube with the given number of elements in
144  // the last dimension.
145  // The record should contain the id values (to get the correct
146  // hypercube) and coordinate values for the elements added.
147  void extendHypercube (uInt incrInLastDim, const Record& values);
148 
149 
150 private:
151  //# Declare the data members.
153 };
154 
155 
156 
157 
158 } //# NAMESPACE CASACORE - END
159 
160 #endif
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
void extendHypercube(uInt incrInLastDim, const Record &values)
Extend the hypercube with the given number of elements in the last dimension.
void addHypercube(const IPosition &cubeShape, const IPosition &tileShape, const Record &values)
Add a hypercube.
Main interface class to a read/write table.
Definition: Table.h:153
String dataManagerName() const
Get the data manager name.
TiledDataStManAccessor & operator=(const TiledDataStManAccessor &that)
Assignment (reference semantics).
A hierarchical collection of named fields of various types.
Definition: Record.h:180
Give access to some TiledDataStMan functions.
Tiled Data Storage Manager.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
const IPosition & tileShape(uInt rownr) const
Get the tile shape of the data in the given row.
Give access to some TiledStMan functions.
unsigned int uInt
Definition: aipstype.h:51
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42