casacore
ISMColumn.h
Go to the documentation of this file.
1 //# ISMColumn.h: A Column in the Incremental Storage Manager
2 //# Copyright (C) 1996,1997,1998,1999,2002
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_ISMCOLUMN_H
29 #define TABLES_ISMCOLUMN_H
30 
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
34 #include <casacore/tables/DataMan/StManColumn.h>
35 #include <casacore/tables/DataMan/ISMBase.h>
36 #include <casacore/casa/Arrays/IPosition.h>
37 #include <casacore/casa/Containers/Block.h>
38 #include <casacore/casa/Utilities/Compare.h>
39 #include <casacore/casa/OS/Conversion.h>
40 
41 namespace casacore { //# NAMESPACE CASACORE - BEGIN
42 
43 //# Forward declarations
44 class ISMBucket;
45 
46 
47 // <summary>
48 // A Column in the Incremental Storage Manager.
49 // </summary>
50 
51 // <use visibility=local>
52 
53 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
54 // </reviewed>
55 
56 // <prerequisite>
57 //# Classes you should understand before using this one.
58 // <li> <linkto class=ISMBase>ISMBase</linkto>
59 // </prerequisite>
60 
61 // <etymology>
62 // ISMColumn represents a Column in the Incremental Storage Manager.
63 // </etymology>
64 
65 // <synopsis>
66 // ISMColumn handles the access to a column containing scalars or direct
67 // arrays of the various data types. It uses class <linkto class=ISMBucket>
68 // ISMBucket</linkto> to get and put the data into the correct bucket.
69 // When the value does not fit in the bucket, the bucket is split
70 // and the new bucket is added to the storage manager.
71 // <p>
72 // The object maintains a variable indicating the last row ever put.
73 // This is used to decide if a put of a value is valid until the
74 // end of the table or for that one row only. In this way it does not
75 // make any difference if rows are added before or after a value is put
76 // <br>
77 // A value put before or at the last row ever put will only affect that
78 // one row. The rows before and after it keep their original value. If
79 // needed that value is copied.
80 // <p>
81 // To optimize (especially sequential) access to the column, ISMColumn
82 // maintains the last value gotten and the rows for which it is valid.
83 // In this way a get does not need to access the data in the bucket.
84 // <p>
85 // ISMColumn use the static conversion functions in the
86 // <linkto class=Conversion>Conversion</linkto> framework to
87 // get/put the data in external format (be it canonical or local).
88 // Most data types are fixed length, but some are variable length
89 // (e.g. String). In external format variable length data is preceeded
90 // by its total length (which includes the length itself). This makes
91 // it possible to get the length of a data value without having to
92 // interpret it, which is easy when (re)moving a value. For this reason
93 // ISMColumn contains its own conversion functions for Strings.
94 // <p>
95 // ISMColumn also acts as the base class for more specialized ISM
96 // column classes (i.e. <linkto class=ISMIndColumn>ISMIndColumn</linkto>
97 // for indirect columns).
98 // In this way <linkto class=ISMBase>ISMBase</linkto> can hold a
99 // block of <src>ISMColumn*</src> for any column. Furthermore
100 // <src>ISMColumn</src> contains the hooks to allow a derived class
101 // to use other ISMColumn functions (e.g. there are "action" functions
102 // for a derived class to react on the duplication or removal of
103 // a data value (e.g. due to a bucket split).
104 // </synopsis>
105 
106 // <motivation>
107 // ISMColumn encapsulates all operations on an ISM Column.
108 // </motivation>
109 
110 //# <todo asof="$DATE:$">
111 //# A List of bugs, limitations, extensions or planned refinements.
112 //# </todo>
113 
114 
115 class ISMColumn : public StManColumn
116 {
117 public:
118  // Create a ISMColumn object with the given parent.
119  // It initializes the various variables.
120  // It keeps the pointer to its parent (but does not own it).
121  ISMColumn (ISMBase* parent, int dataType, uInt colnr);
122 
123  ~ISMColumn();
124 
125  // Set the shape of an array in the column.
126  virtual void setShapeColumn (const IPosition& shape);
127 
128  // Get the dimensionality of the item in the given row.
129  // This is the same for all rows.
130  virtual uInt ndim (uInt rownr);
131 
132  // Get the shape of the array in the given row.
133  // This is the same for all rows.
134  virtual IPosition shape (uInt rownr);
135 
136  // Let the column object initialize itself for a newly created table.
137  // This is meant for a derived class.
138  virtual void doCreate (ISMBucket*);
139 
140  // Let the column object initialize itself for an existing table.
141  virtual void getFile (uInt nrrow);
142 
143  // Flush and optionally fsync the data.
144  // This is meant for a derived class.
145  virtual Bool flush (uInt nrrow, Bool fsync);
146 
147  // Resync the storage manager with the new file contents.
148  // It resets the last rownr put.
149  void resync (uInt nrrow);
150 
151  // Let the column reopen its data files for read/write access.
152  virtual void reopenRW();
153 
154  // Get a scalar value in the given row.
155  // <group>
156  virtual void getBoolV (uInt rownr, Bool* dataPtr);
157  virtual void getuCharV (uInt rownr, uChar* dataPtr);
158  virtual void getShortV (uInt rownr, Short* dataPtr);
159  virtual void getuShortV (uInt rownr, uShort* dataPtr);
160  virtual void getIntV (uInt rownr, Int* dataPtr);
161  virtual void getuIntV (uInt rownr, uInt* dataPtr);
162  virtual void getfloatV (uInt rownr, float* dataPtr);
163  virtual void getdoubleV (uInt rownr, double* dataPtr);
164  virtual void getComplexV (uInt rownr, Complex* dataPtr);
165  virtual void getDComplexV (uInt rownr, DComplex* dataPtr);
166  virtual void getStringV (uInt rownr, String* dataPtr);
167  // </group>
168 
169  // Put a scalar value in the given row.
170  // <group>
171  virtual void putBoolV (uInt rownr, const Bool* dataPtr);
172  virtual void putuCharV (uInt rownr, const uChar* dataPtr);
173  virtual void putShortV (uInt rownr, const Short* dataPtr);
174  virtual void putuShortV (uInt rownr, const uShort* dataPtr);
175  virtual void putIntV (uInt rownr, const Int* dataPtr);
176  virtual void putuIntV (uInt rownr, const uInt* dataPtr);
177  virtual void putfloatV (uInt rownr, const float* dataPtr);
178  virtual void putdoubleV (uInt rownr, const double* dataPtr);
179  virtual void putComplexV (uInt rownr, const Complex* dataPtr);
180  virtual void putDComplexV (uInt rownr, const DComplex* dataPtr);
181  virtual void putStringV (uInt rownr, const String* dataPtr);
182  // </group>
183 
184  // Get the scalar values in the entire column.
185  // The buffer pointed to by dataPtr has to have the correct length.
186  // (which is guaranteed by the ScalarColumn getColumn function).
187  // <group>
188  virtual void getScalarColumnBoolV (Vector<Bool>* dataPtr);
189  virtual void getScalarColumnuCharV (Vector<uChar>* dataPtr);
190  virtual void getScalarColumnShortV (Vector<Short>* dataPtr);
191  virtual void getScalarColumnuShortV (Vector<uShort>* dataPtr);
192  virtual void getScalarColumnIntV (Vector<Int>* dataPtr);
193  virtual void getScalarColumnuIntV (Vector<uInt>* dataPtr);
194  virtual void getScalarColumnfloatV (Vector<float>* dataPtr);
195  virtual void getScalarColumndoubleV (Vector<double>* dataPtr);
196  virtual void getScalarColumnComplexV (Vector<Complex>* dataPtr);
197  virtual void getScalarColumnDComplexV (Vector<DComplex>* dataPtr);
198  virtual void getScalarColumnStringV (Vector<String>* dataPtr);
199  // </group>
200 
201  // Put the scalar values into the entire column.
202  // The buffer pointed to by dataPtr has to have the correct length.
203  // (which is guaranteed by the ScalarColumn putColumn function).
204  // <group>
205  virtual void putScalarColumnBoolV (const Vector<Bool>* dataPtr);
206  virtual void putScalarColumnuCharV (const Vector<uChar>* dataPtr);
207  virtual void putScalarColumnShortV (const Vector<Short>* dataPtr);
208  virtual void putScalarColumnuShortV (const Vector<uShort>* dataPtr);
209  virtual void putScalarColumnIntV (const Vector<Int>* dataPtr);
210  virtual void putScalarColumnuIntV (const Vector<uInt>* dataPtr);
211  virtual void putScalarColumnfloatV (const Vector<float>* dataPtr);
212  virtual void putScalarColumndoubleV (const Vector<double>* dataPtr);
213  virtual void putScalarColumnComplexV (const Vector<Complex>* dataPtr);
214  virtual void putScalarColumnDComplexV (const Vector<DComplex>* dataPtr);
215  virtual void putScalarColumnStringV (const Vector<String>* dataPtr);
216  // </group>
217 
218  // Get the scalar values in some cells of the column.
219  // The buffer pointed to by dataPtr has to have the correct length.
220  // (which is guaranteed by the ScalarColumn getColumnCells function).
221  // The default implementation loops through all rows.
222  // <group>
223  virtual void getScalarColumnCellsBoolV (const RefRows& rownrs,
224  Vector<Bool>* dataPtr);
225  virtual void getScalarColumnCellsuCharV (const RefRows& rownrs,
226  Vector<uChar>* dataPtr);
227  virtual void getScalarColumnCellsShortV (const RefRows& rownrs,
228  Vector<Short>* dataPtr);
229  virtual void getScalarColumnCellsuShortV (const RefRows& rownrs,
230  Vector<uShort>* dataPtr);
231  virtual void getScalarColumnCellsIntV (const RefRows& rownrs,
232  Vector<Int>* dataPtr);
233  virtual void getScalarColumnCellsuIntV (const RefRows& rownrs,
234  Vector<uInt>* dataPtr);
235  virtual void getScalarColumnCellsfloatV (const RefRows& rownrs,
236  Vector<float>* dataPtr);
237  virtual void getScalarColumnCellsdoubleV (const RefRows& rownrs,
238  Vector<double>* dataPtr);
239  virtual void getScalarColumnCellsComplexV (const RefRows& rownrs,
240  Vector<Complex>* dataPtr);
241  virtual void getScalarColumnCellsDComplexV (const RefRows& rownrs,
242  Vector<DComplex>* dataPtr);
243  virtual void getScalarColumnCellsStringV (const RefRows& rownrs,
244  Vector<String>* dataPtr);
245  // </group>
246 
247  // Get an array value in the given row.
248  // <group>
249  virtual void getArrayBoolV (uInt rownr, Array<Bool>* dataPtr);
250  virtual void getArrayuCharV (uInt rownr, Array<uChar>* dataPtr);
251  virtual void getArrayShortV (uInt rownr, Array<Short>* dataPtr);
252  virtual void getArrayuShortV (uInt rownr, Array<uShort>* dataPtr);
253  virtual void getArrayIntV (uInt rownr, Array<Int>* dataPtr);
254  virtual void getArrayuIntV (uInt rownr, Array<uInt>* dataPtr);
255  virtual void getArrayfloatV (uInt rownr, Array<float>* dataPtr);
256  virtual void getArraydoubleV (uInt rownr, Array<double>* dataPtr);
257  virtual void getArrayComplexV (uInt rownr, Array<Complex>* dataPtr);
258  virtual void getArrayDComplexV (uInt rownr, Array<DComplex>* dataPtr);
259  virtual void getArrayStringV (uInt rownr, Array<String>* dataPtr);
260  // </group>
261 
262  // Put an array value in the given row.
263  // <group>
264  virtual void putArrayBoolV (uInt rownr, const Array<Bool>* dataPtr);
265  virtual void putArrayuCharV (uInt rownr, const Array<uChar>* dataPtr);
266  virtual void putArrayShortV (uInt rownr, const Array<Short>* dataPtr);
267  virtual void putArrayuShortV (uInt rownr, const Array<uShort>* dataPtr);
268  virtual void putArrayIntV (uInt rownr, const Array<Int>* dataPtr);
269  virtual void putArrayuIntV (uInt rownr, const Array<uInt>* dataPtr);
270  virtual void putArrayfloatV (uInt rownr, const Array<float>* dataPtr);
271  virtual void putArraydoubleV (uInt rownr, const Array<double>* dataPtr);
272  virtual void putArrayComplexV (uInt rownr, const Array<Complex>* dataPtr);
273  virtual void putArrayDComplexV (uInt rownr, const Array<DComplex>* dataPtr);
274  virtual void putArrayStringV (uInt rownr, const Array<String>* dataPtr);
275  // </group>
276 
277  // Add (newNrrow-oldNrrow) rows to the column and initialize
278  // the new rows when needed.
279  virtual void addRow (uInt newNrrow, uInt oldNrrow);
280 
281  // Remove the given row in the bucket from the column.
282  void remove (uInt bucketRownr, ISMBucket* bucket, uInt bucketNrrow,
283  uInt newNrrow);
284 
285  // Get the function needed to read/write a uInt from/to external format.
286  // This is used by other classes to read the length of a variable
287  // data value.
288  // <group>
289  static Conversion::ValueFunction* getReaduInt (Bool asCanonical);
290  static Conversion::ValueFunction* getWriteuInt (Bool asCanonical);
291  // </group>
292 
293  // Give a derived class the opportunity to react on the duplication
294  // of a value. It is used by ISMIndColumn.
295  virtual void handleCopy (uInt rownr, const char* value);
296 
297  // Give a derived class the opportunity to react on the removal
298  // of a value. It is used by ISMIndColumn.
299  virtual void handleRemove (uInt rownr, const char* value);
300 
301  // Get the fixed length of the data value in a cell of this column
302  // (0 = variable length).
303  uInt getFixedLength() const;
304 
305  // Get the nr of elements in this data value.
306  uInt nelements() const;
307 
308 
309 protected:
310  // Test if the last value is invalid for this row.
311  int isLastValueInvalid (Int rownr) const;
312 
313  // Get the value for this row.
314  // Set the cache if the flag is set.
315  void getValue (uInt rownr, void* value, Bool setCache);
316 
317  // Put the value for this row.
318  void putValue (uInt rownr, const void* value);
319 
320  //# Declare member variables.
321  // Pointer to the parent storage manager.
323  // Length of column cell value in storage format (0 = variable length).
324  // If 0, the value is always preceeded by a uInt giving the length.
326  // Column sequence number of this column.
328  // The shape of the column.
330  // Number of elements in a value for this column.
332  // Number of values to be copied.
333  // Normally this is nrelem_p, but for complex types it is 2*nrelem_p.
334  // When local format is used, it is the number of bytes.
336  // Cache for interval for which last value read is valid.
337  // The last value is valid for startRow_p till endRow_p (inclusive).
340  void* lastValue_p;
341  // The last row for which a value has been put.
343  // The size of the data type in local format.
345  // Pointer to a convert function for writing.
347  // Pointer to a convert function for reading.
349  // Pointer to a compare function.
350  ObjCompareFunc* compareFunc_p;
351 
352 
353 private:
354  // Forbid copy constructor.
355  ISMColumn (const ISMColumn&);
356 
357  // Forbid assignment.
358  ISMColumn& operator= (const ISMColumn&);
359 
360  // Initialize part of the object.
361  // It is used by doCreate and getFile.
362  void init();
363 
364  // Clear the object (used by destructor and init).
365  void clear();
366 
367  // Put the value in all buckets from the given row on.
368  void putFromRow (uInt rownr, const char* data, uInt lenData);
369 
370  // Put a data value into the bucket.
371  // When it is at the first row of the bucket, it replaces the value.
372  // Otherwise it is added.
373  void putData (ISMBucket* bucket, uInt bucketStartRow,
374  uInt bucketNrrow, uInt bucketRownr,
375  const char* data, uInt lenData,
376  Bool afterLastRow, Bool canSplit);
377 
378  // Replace a value at the given offset in the bucket.
379  // If the bucket is too small, it will be split (if allowed).
380  void replaceData (ISMBucket* bucket, uInt bucketStartRow,
381  uInt bucketNrrow, uInt bucketRownr, uInt& offset,
382  const char* data, uInt lenData, Bool canSplit = True);
383 
384  // Add a value at the given index in the bucket.
385  // If the bucket is too small, it will be split (if allowed).
386  Bool addData (ISMBucket* bucket, uInt bucketStartRow,
387  uInt bucketNrrow, uInt bucketRownr, uInt inx,
388  const char* data, uInt lenData,
389  Bool afterLastRow = False, Bool canSplit = True);
390 
391  // Handle the duplicated values after a bucket split.
392  void handleSplit (ISMBucket& bucket, const Block<Bool>& duplicated);
393 
394  // Compare the values.
395  virtual Bool compareValue (const void* val1, const void* val2) const;
396 
397  // Handle a String in copying to/from external format.
398  // <group>
399  static size_t fromString (void* out, const void* in, size_t n,
400  Conversion::ValueFunction* writeLeng);
401  static size_t toString (void* out, const void* in, size_t n,
402  Conversion::ValueFunction* readLeng);
403  static size_t writeStringBE (void* out, const void* in, size_t n);
404  static size_t readStringBE (void* out, const void* in, size_t n);
405  static size_t writeStringLE (void* out, const void* in, size_t n);
406  static size_t readStringLE (void* out, const void* in, size_t n);
407  // </group>
408 };
409 
410 
411 inline int ISMColumn::isLastValueInvalid (Int rownr) const
412 {
413  return rownr < startRow_p || rownr > endRow_p;
414 }
415 
417 {
418  return fixedLength_p;
419 }
420 
422 {
423  return nrelem_p;
424 }
425 
426 
427 
428 } //# NAMESPACE CASACORE - END
429 
430 #endif
A Vector of integers, for indexing into Array<T> objects.
Definition: IPosition.h:119
void getValue(uInt rownr, void *value, Bool setCache)
Get the value for this row.
virtual void putScalarColumnuShortV(const Vector< uShort > *dataPtr)
virtual void putArrayuCharV(uInt rownr, const Array< uChar > *dataPtr)
virtual void getScalarColumnCellsuIntV(const RefRows &rownrs, Vector< uInt > *dataPtr)
virtual void putComplexV(uInt rownr, const Complex *dataPtr)
virtual void getScalarColumnCellsStringV(const RefRows &rownrs, Vector< String > *dataPtr)
virtual void getScalarColumnDComplexV(Vector< DComplex > *dataPtr)
virtual void putArrayShortV(uInt rownr, const Array< Short > *dataPtr)
int Int
Definition: aipstype.h:47
virtual void getfloatV(uInt rownr, float *dataPtr)
virtual void doCreate(ISMBucket *)
Let the column object initialize itself for a newly created table.
uInt colnr_p
Column sequence number of this column.
Definition: ISMColumn.h:327
virtual void putArrayuIntV(uInt rownr, const Array< uInt > *dataPtr)
virtual void putuIntV(uInt rownr, const uInt *dataPtr)
virtual void putScalarColumnDComplexV(const Vector< DComplex > *dataPtr)
void replaceData(ISMBucket *bucket, uInt bucketStartRow, uInt bucketNrrow, uInt bucketRownr, uInt &offset, const char *data, uInt lenData, Bool canSplit=True)
Replace a value at the given offset in the bucket.
Conversion::ValueFunction * readFunc_p
Pointer to a convert function for reading.
Definition: ISMColumn.h:348
virtual void getScalarColumnIntV(Vector< Int > *dataPtr)
virtual void putArrayuShortV(uInt rownr, const Array< uShort > *dataPtr)
virtual void putShortV(uInt rownr, const Short *dataPtr)
void putData(ISMBucket *bucket, uInt bucketStartRow, uInt bucketNrrow, uInt bucketRownr, const char *data, uInt lenData, Bool afterLastRow, Bool canSplit)
Put a data value into the bucket.
static size_t writeStringLE(void *out, const void *in, size_t n)
virtual void putDComplexV(uInt rownr, const DComplex *dataPtr)
virtual void getScalarColumnuShortV(Vector< uShort > *dataPtr)
virtual void putdoubleV(uInt rownr, const double *dataPtr)
virtual void putScalarColumnComplexV(const Vector< Complex > *dataPtr)
virtual void getScalarColumnCellsShortV(const RefRows &rownrs, Vector< Short > *dataPtr)
Bool addData(ISMBucket *bucket, uInt bucketStartRow, uInt bucketNrrow, uInt bucketRownr, uInt inx, const char *data, uInt lenData, Bool afterLastRow=False, Bool canSplit=True)
Add a value at the given index in the bucket.
virtual void getScalarColumnuIntV(Vector< uInt > *dataPtr)
virtual void handleCopy(uInt rownr, const char *value)
Give a derived class the opportunity to react on the duplication of a value.
void resync(uInt nrrow)
Resync the storage manager with the new file contents.
virtual void getArrayuIntV(uInt rownr, Array< uInt > *dataPtr)
virtual void getScalarColumnuCharV(Vector< uChar > *dataPtr)
uInt typeSize_p
The size of the data type in local format.
Definition: ISMColumn.h:344
virtual void getuCharV(uInt rownr, uChar *dataPtr)
virtual void putArrayfloatV(uInt rownr, const Array< float > *dataPtr)
virtual void getuIntV(uInt rownr, uInt *dataPtr)
virtual void putStringV(uInt rownr, const String *dataPtr)
unsigned char uChar
Definition: aipstype.h:44
static size_t toString(void *out, const void *in, size_t n, Conversion::ValueFunction *readLeng)
virtual void getArrayStringV(uInt rownr, Array< String > *dataPtr)
virtual void putScalarColumnShortV(const Vector< Short > *dataPtr)
void init()
Initialize part of the object.
virtual void getScalarColumnCellsdoubleV(const RefRows &rownrs, Vector< double > *dataPtr)
virtual void getScalarColumnCellsfloatV(const RefRows &rownrs, Vector< float > *dataPtr)
virtual void getScalarColumnComplexV(Vector< Complex > *dataPtr)
static size_t fromString(void *out, const void *in, size_t n, Conversion::ValueFunction *writeLeng)
Handle a String in copying to/from external format.
virtual IPosition shape(uInt rownr)
Get the shape of the array in the given row.
virtual void getScalarColumnCellsuCharV(const RefRows &rownrs, Vector< uChar > *dataPtr)
void putFromRow(uInt rownr, const char *data, uInt lenData)
Put the value in all buckets from the given row on.
virtual void getArrayuShortV(uInt rownr, Array< uShort > *dataPtr)
static size_t readStringLE(void *out, const void *in, size_t n)
int dataType() const
Return the data type of the column.
virtual void getFile(uInt nrrow)
Let the column object initialize itself for an existing table.
virtual void getComplexV(uInt rownr, Complex *dataPtr)
virtual void putArrayStringV(uInt rownr, const Array< String > *dataPtr)
virtual void getArrayDComplexV(uInt rownr, Array< DComplex > *dataPtr)
IPosition shape_p
The shape of the column.
Definition: ISMColumn.h:329
short Short
Definition: aipstype.h:45
static Conversion::ValueFunction * getReaduInt(Bool asCanonical)
Get the function needed to read/write a uInt from/to external format.
Int startRow_p
Cache for interval for which last value read is valid.
Definition: ISMColumn.h:338
Base class of the Incremental Storage Manager.
Definition: ISMBase.h:87
virtual void addRow(uInt newNrrow, uInt oldNrrow)
Add (newNrrow-oldNrrow) rows to the column and initialize the new rows when needed.
Conversion::ValueFunction * writeFunc_p
Pointer to a convert function for writing.
Definition: ISMColumn.h:346
virtual void getStringV(uInt rownr, String *dataPtr)
virtual void getdoubleV(uInt rownr, double *dataPtr)
ObjCompareFunc * compareFunc_p
Pointer to a compare function.
Definition: ISMColumn.h:350
virtual void setShapeColumn(const IPosition &shape)
Set the shape of an array in the column.
virtual void getScalarColumnBoolV(Vector< Bool > *dataPtr)
Get the scalar values in the entire column.
virtual void getScalarColumnCellsuShortV(const RefRows &rownrs, Vector< uShort > *dataPtr)
virtual void putArrayIntV(uInt rownr, const Array< Int > *dataPtr)
virtual void getArraydoubleV(uInt rownr, Array< double > *dataPtr)
virtual void putScalarColumndoubleV(const Vector< double > *dataPtr)
virtual Bool compareValue(const void *val1, const void *val2) const
Compare the values.
virtual void reopenRW()
Let the column reopen its data files for read/write access.
Class holding the row numbers in a RefTable.
Definition: RefRows.h:85
virtual void getArrayIntV(uInt rownr, Array< Int > *dataPtr)
uInt nelements() const
Get the nr of elements in this data value.
Definition: ISMColumn.h:421
void putValue(uInt rownr, const void *value)
Put the value for this row.
virtual void getIntV(uInt rownr, Int *dataPtr)
virtual void handleRemove(uInt rownr, const char *value)
Give a derived class the opportunity to react on the removal of a value.
virtual void getScalarColumnfloatV(Vector< float > *dataPtr)
virtual void putuShortV(uInt rownr, const uShort *dataPtr)
virtual void putScalarColumnfloatV(const Vector< float > *dataPtr)
virtual void getScalarColumnCellsIntV(const RefRows &rownrs, Vector< Int > *dataPtr)
virtual void getArrayfloatV(uInt rownr, Array< float > *dataPtr)
uInt fixedLength_p
Length of column cell value in storage format (0 = variable length).
Definition: ISMColumn.h:325
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:39
virtual void getArrayBoolV(uInt rownr, Array< Bool > *dataPtr)
Get an array value in the given row.
virtual void getuShortV(uInt rownr, uShort *dataPtr)
virtual void getScalarColumnCellsDComplexV(const RefRows &rownrs, Vector< DComplex > *dataPtr)
virtual void putArrayComplexV(uInt rownr, const Array< Complex > *dataPtr)
virtual void putArrayBoolV(uInt rownr, const Array< Bool > *dataPtr)
Put an array value in the given row.
const Bool False
Definition: aipstype.h:41
static Conversion::ValueFunction * getWriteuInt(Bool asCanonical)
virtual void getArrayuCharV(uInt rownr, Array< uChar > *dataPtr)
ISMColumn & operator=(const ISMColumn &)
Forbid assignment.
uInt lastRowPut_p
The last row for which a value has been put.
Definition: ISMColumn.h:342
A Column in the Incremental Storage Manager.
Definition: ISMColumn.h:115
virtual void putfloatV(uInt rownr, const float *dataPtr)
static size_t writeStringBE(void *out, const void *in, size_t n)
virtual void putIntV(uInt rownr, const Int *dataPtr)
A bucket in the Incremental Storage Manager.
Definition: ISMBucket.h:132
virtual void putScalarColumnuIntV(const Vector< uInt > *dataPtr)
virtual Bool flush(uInt nrrow, Bool fsync)
Flush and optionally fsync the data.
virtual void getBoolV(uInt rownr, Bool *dataPtr)
Get a scalar value in the given row.
virtual void putScalarColumnStringV(const Vector< String > *dataPtr)
virtual void getScalarColumnCellsBoolV(const RefRows &rownrs, Vector< Bool > *dataPtr)
Get the scalar values in some cells of the column.
uInt nrelem_p
Number of elements in a value for this column.
Definition: ISMColumn.h:331
virtual void getArrayComplexV(uInt rownr, Array< Complex > *dataPtr)
uInt getFixedLength() const
Get the fixed length of the data value in a cell of this column (0 = variable length).
Definition: ISMColumn.h:416
virtual void putBoolV(uInt rownr, const Bool *dataPtr)
Put a scalar value in the given row.
String: the storage and methods of handling collections of characters.
Definition: String.h:223
virtual uInt ndim(uInt rownr)
Get the dimensionality of the item in the given row.
virtual void getScalarColumndoubleV(Vector< double > *dataPtr)
void clear()
Clear the object (used by destructor and init).
void handleSplit(ISMBucket &bucket, const Block< Bool > &duplicated)
Handle the duplicated values after a bucket split.
virtual void getScalarColumnCellsComplexV(const RefRows &rownrs, Vector< Complex > *dataPtr)
static size_t readStringBE(void *out, const void *in, size_t n)
int isLastValueInvalid(Int rownr) const
Test if the last value is invalid for this row.
Definition: ISMColumn.h:411
virtual void getScalarColumnStringV(Vector< String > *dataPtr)
uInt nrcopy_p
Number of values to be copied.
Definition: ISMColumn.h:335
virtual void getScalarColumnShortV(Vector< Short > *dataPtr)
Base table column storage manager class.
Definition: StManColumn.h:102
virtual void putArraydoubleV(uInt rownr, const Array< double > *dataPtr)
virtual void putScalarColumnIntV(const Vector< Int > *dataPtr)
virtual void getShortV(uInt rownr, Short *dataPtr)
const Bool True
Definition: aipstype.h:40
virtual void putScalarColumnuCharV(const Vector< uChar > *dataPtr)
this file contains all the compiler specific defines
Definition: mainpage.dox:28
ISMBase * stmanPtr_p
Pointer to the parent storage manager.
Definition: ISMColumn.h:322
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
virtual void getArrayShortV(uInt rownr, Array< Short > *dataPtr)
virtual void putArrayDComplexV(uInt rownr, const Array< DComplex > *dataPtr)
ISMColumn(ISMBase *parent, int dataType, uInt colnr)
Create a ISMColumn object with the given parent.
unsigned int uInt
Definition: aipstype.h:48
size_t ValueFunction(void *to, const void *from, size_t nvalues)
Define the signature of a function converting nvalues values from internal to external format or vice...
Definition: Conversion.h:100
virtual void getDComplexV(uInt rownr, DComplex *dataPtr)
unsigned short uShort
Definition: aipstype.h:46
virtual void putuCharV(uInt rownr, const uChar *dataPtr)
virtual void putScalarColumnBoolV(const Vector< Bool > *dataPtr)
Put the scalar values into the entire column.