casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SSMIndStringColumn.h
Go to the documentation of this file.
1 //# SSMIndStringColumn.h: An Indirect String Array Column in the SSM
2 //# Copyright (C) 2000
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_SSMINDSTRINGCOLUMN_H
29 #define TABLES_SSMINDSTRINGCOLUMN_H
30 
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
35 
36 namespace casacore { //# NAMESPACE CASACORE - BEGIN
37 
38 //# Forward declarations
39 
40 
41 // <summary>
42 // An Indirect String Array Column in the Standard Storage Manager.
43 // </summary>
44 
45 // <use visibility=local>
46 
47 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tSSMStringHandler.cc">
48 // </reviewed>
49 
50 // <prerequisite>
51 //# Classes you should understand before using this one.
52 // <li> <linkto class=SSMBase>SSMBase</linkto>
53 // <li> <linkto class=SSMDirColumn>SSMColumn</linkto>
54 // <li> <linkto class=SSMStringHandler>SSMStringHandler</linkto>
55 // </prerequisite>
56 
57 // <etymology>
58 // SSMIndStringColumn represents an Indirect String Array Column in the
59 // Standard Storage Manager.
60 // </etymology>
61 
62 // <synopsis>
63 // SSMIndStringColumn handles indirect variable shaped string arrays.
64 // Note that indirect fixed shape string arrays are handled by
65 // <linkto class=SSMDirColumn>SSMDirColumn</linkto>.
66 // <p>
67 // All string array access is handled by class
68 // <linkto class=SSMStringHandler>SSMStringHandler</linkto>, so
69 // SSMIndStringColumn is merely an interface to this class.
70 // The only thing it does is accessing the bucketnr, offset, and length
71 // in the data bucket.
72 // </synopsis>
73 
74 // <motivation>
75 // The reason that indirect string arrays are handled here instead of
76 // in <linkto class=SSMIndColumn>SSMIndColumn</linkto> is that the string
77 // buckets are more disk space efficient when string arrays are frequently
78 // updated.
79 // </motivation>
80 
81 //# <todo asof="$DATE:$">
82 //# A List of bugs, limitations, extensions or planned refinements.
83 //# </todo>
84 
85 
87 {
88 public:
89  // Create a SSMIndStringColumn object with the given parent.
90  // It initializes the various variables.
91  // It keeps the pointer to its parent (but does not own it).
92  SSMIndStringColumn (SSMBase* aParent, int aDataType, uInt aColNr);
93 
94  virtual ~SSMIndStringColumn();
95 
96  // Get an array value in the given row.
97  // An exception is thrown if no array is defined in this row.
98  virtual void getArrayStringV (uInt rownr, Array<String>* dataPtr);
99 
100  // Put an array value in the given row.
101  virtual void putArrayStringV (uInt rownr, const Array<String>* dataPtr);
102 
103  // Set the shape of the array in the given row.
104  void setShape (uInt aRowNr, const IPosition& aShape);
105 
106  // Get the shape of the array in the given row.
107  virtual IPosition shape (uInt aRowNr);
108 
109  // This storage manager can handle changing array shapes.
110  Bool canChangeShape() const;
111 
112  // Is the shape defined (i.e. is there an array) in this row?
113  virtual Bool isShapeDefined (uInt aRowNr);
114 
115  // Get the dimensionality of the item in the given row.
116  virtual uInt ndim (uInt aRowNr);
117 
118 
119 private:
120  // Forbid copy constructor.
122 
123  // Forbid assignment.
125 };
126 
127 
128 
129 } //# NAMESPACE CASACORE - END
130 
131 #endif
132 
133 
134 
135 
A Vector of integers, for indexing into Array&lt;T&gt; objects.
Definition: IPosition.h:119
A Direct Array Column in the Standard Storage Manager.
Definition: SSMDirColumn.h:78
virtual Bool isShapeDefined(uInt aRowNr)
Is the shape defined (i.e.
Base class of the Standard Storage Manager.
Definition: SSMBase.h:158
An Indirect String Array Column in the Standard Storage Manager.
virtual IPosition shape(uInt aRowNr)
Get the shape of the array in the given row.
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
SSMIndStringColumn & operator=(const SSMIndStringColumn &)
Forbid assignment.
void setShape(uInt aRowNr, const IPosition &aShape)
Set the shape of the array in the given row.
template &lt;class T, class U&gt; class vector;
Definition: MSFlagger.h:37
SSMIndStringColumn(SSMBase *aParent, int aDataType, uInt aColNr)
Create a SSMIndStringColumn object with the given parent.
virtual uInt ndim(uInt aRowNr)
Get the dimensionality of the item in the given row.
Bool canChangeShape() const
This storage manager can handle changing array shapes.
virtual void getArrayStringV(uInt rownr, Array< String > *dataPtr)
Get an array value in the given row.
virtual void putArrayStringV(uInt rownr, const Array< String > *dataPtr)
Put an array value in the given row.
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