casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TSMIdColumn.h
Go to the documentation of this file.
00001 //# TSMIdColumn.h: An id column in Tiled Storage Manager
00002 //# Copyright (C) 1995,1996,1997,1999
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //# $Id: TSMIdColumn.h 20551 2009-03-25 00:11:33Z Malte.Marquarding $
00027 
00028 #ifndef TABLES_TSMIDCOLUMN_H
00029 #define TABLES_TSMIDCOLUMN_H
00030 
00031 //# Includes
00032 #include <casa/aips.h>
00033 #include <tables/Tables/TSMColumn.h>
00034 #include <casa/Arrays/IPosition.h>
00035 #include <casa/BasicSL/String.h>
00036 
00037 namespace casa { //# NAMESPACE CASA - BEGIN
00038 
00039 //# Forward Declarations
00040 
00041 
00042 // <summary>
00043 // An id column in Tiled Storage Manager.
00044 // </summary>
00045 
00046 // <use visibility=local>
00047 
00048 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
00049 // </reviewed>
00050 
00051 // <prerequisite>
00052 //# Classes you should understand before using this one.
00053 //   <li> <linkto class=TSMColumn>TSMColumn</linkto>
00054 //   <li> <linkto class=TSMCube>TSMCube</linkto>
00055 //   <li> <linkto class=Record>Record</linkto>
00056 // </prerequisite>
00057 
00058 // <etymology>
00059 // TSMIdColumn handles an id column for a Tiled
00060 // Storage Manager.
00061 // </etymology>
00062 
00063 // <synopsis> 
00064 // TSMIdColumn is used by
00065 // <linkto class=TiledStMan>TiledStMan</linkto>
00066 // to handle the access to
00067 // a table column containing an id value of a tiled hypercube.
00068 // Explicitly putting an id value is not possible. The only way to
00069 // define the value is by specifying it when adding a hypercube
00070 // in <linkto class=TiledDataStMan>TiledDataStMan</linkto>.
00071 // <p>
00072 // The id values are held in a TSMCube object. The row number
00073 // determines which TSMCube object has to be accessed.
00074 // <p>
00075 // The creation of a TSMIdColumn object is done by a TSMColumn object.
00076 // This process is described in more detail in the class
00077 // <linkto class=TSMColumn>TSMColumn</linkto>.
00078 // </synopsis> 
00079 
00080 // <motivation>
00081 // Handling coordinate columns in the Tiled Storage Manager is
00082 // different from other columns.
00083 // </motivation>
00084 
00085 //# <todo asof="$DATE:$">
00086 //# A List of bugs, limitations, extensions or planned refinements.
00087 //# </todo>
00088 
00089 
00090 class TSMIdColumn : public TSMColumn
00091 {
00092 public:
00093 
00094     // Create an id column from the given column.
00095     TSMIdColumn (const TSMColumn& column);
00096 
00097     // Frees up the storage.
00098     virtual ~TSMIdColumn();
00099 
00100     // Get a scalar value in the given row.
00101     // The buffer pointed to by dataPtr has to have the correct length
00102     // (which is guaranteed by the ScalarColumn get function).
00103     // <group>
00104     void getBoolV     (uInt rownr, Bool* dataPtr);
00105     void getIntV      (uInt rownr, Int* dataPtr);
00106     void getuIntV     (uInt rownr, uInt* dataPtr);
00107     void getfloatV    (uInt rownr, float* dataPtr);
00108     void getdoubleV   (uInt rownr, double* dataPtr);
00109     void getComplexV  (uInt rownr, Complex* dataPtr);
00110     void getDComplexV (uInt rownr, DComplex* dataPtr);
00111     void getStringV   (uInt rownr, String* dataPtr);
00112     // </group>
00113 
00114     // Put a scalar value in the given row.
00115     // The buffer pointed to by dataPtr has to have the correct length
00116     // (which is guaranteed by the ScalarColumn get function).
00117     // The value to be put must match the value which has already
00118     // been inserted by the TiledStMan::addHypercube function.
00119     // The put function is only there to be fully orthogonal.
00120     // <group>
00121     void putBoolV     (uInt rownr, const Bool* dataPtr);
00122     void putIntV      (uInt rownr, const Int* dataPtr);
00123     void putuIntV     (uInt rownr, const uInt* dataPtr);
00124     void putfloatV    (uInt rownr, const float* dataPtr);
00125     void putdoubleV   (uInt rownr, const double* dataPtr);
00126     void putComplexV  (uInt rownr, const Complex* dataPtr);
00127     void putDComplexV (uInt rownr, const DComplex* dataPtr);
00128     void putStringV   (uInt rownr, const String* dataPtr);
00129     // </group>
00130 
00131 private:
00132     // Forbid copy constructor.
00133     TSMIdColumn (const TSMIdColumn&);
00134 
00135     // Forbid assignment.
00136     TSMIdColumn& operator= (const TSMIdColumn&);
00137 };
00138 
00139 
00140 
00141 
00142 } //# NAMESPACE CASA - END
00143 
00144 #endif