casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
SSMIndStringColumn.h
Go to the documentation of this file.
00001 //# SSMIndStringColumn.h: An Indirect String Array Column in the SSM
00002 //# Copyright (C) 2000
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: SSMIndStringColumn.h 20551 2009-03-25 00:11:33Z Malte.Marquarding $
00027 
00028 #ifndef TABLES_SSMINDSTRINGCOLUMN_H
00029 #define TABLES_SSMINDSTRINGCOLUMN_H
00030 
00031 
00032 //# Includes
00033 #include <casa/aips.h>
00034 #include <tables/Tables/SSMDirColumn.h>
00035 
00036 namespace casa { //# NAMESPACE CASA - BEGIN
00037 
00038 //# Forward declarations
00039 
00040 
00041 // <summary>
00042 // An Indirect String Array Column in the Standard Storage Manager.
00043 // </summary>
00044 
00045 // <use visibility=local>
00046 
00047 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tSSMStringHandler.cc">
00048 // </reviewed>
00049 
00050 // <prerequisite>
00051 //# Classes you should understand before using this one.
00052 //   <li> <linkto class=SSMBase>SSMBase</linkto>
00053 //   <li> <linkto class=SSMDirColumn>SSMColumn</linkto>
00054 //   <li> <linkto class=SSMStringHandler>SSMStringHandler</linkto>
00055 // </prerequisite>
00056 
00057 // <etymology>
00058 // SSMIndStringColumn represents an Indirect String Array Column in the 
00059 // Standard Storage Manager.
00060 // </etymology>
00061 
00062 // <synopsis>
00063 // SSMIndStringColumn handles indirect variable shaped string arrays.
00064 // Note that indirect fixed shape string arrays are handled by
00065 // <linkto class=SSMDirColumn>SSMDirColumn</linkto>.
00066 // <p>
00067 // All string array access is handled by class
00068 // <linkto class=SSMStringHandler>SSMStringHandler</linkto>, so
00069 // SSMIndStringColumn is merely an interface to this class.
00070 // The only thing it does is accessing the bucketnr, offset, and length
00071 // in the data bucket.
00072 // </synopsis>
00073   
00074 // <motivation>
00075 // The reason that indirect string arrays are handled here instead of
00076 // in <linkto class=SSMIndColumn>SSMIndColumn</linkto> is that the string
00077 // buckets are more disk space efficient when string arrays are frequently
00078 // updated.
00079 // </motivation>
00080 
00081 //# <todo asof="$DATE:$">
00082 //# A List of bugs, limitations, extensions or planned refinements.
00083 //# </todo>
00084 
00085 
00086 class SSMIndStringColumn : public SSMDirColumn
00087 {
00088 public:
00089   // Create a SSMIndStringColumn object with the given parent.
00090   // It initializes the various variables.
00091   // It keeps the pointer to its parent (but does not own it).
00092   SSMIndStringColumn (SSMBase* aParent, int aDataType, uInt aColNr);
00093   
00094   virtual ~SSMIndStringColumn();
00095 
00096   // Get an array value in the given row.
00097   // An exception is thrown if no array is defined in this row.
00098   virtual void getArrayStringV (uInt rownr, Array<String>* dataPtr);
00099   
00100   // Put an array value in the given row.
00101   virtual void putArrayStringV (uInt rownr, const Array<String>* dataPtr);
00102 
00103   // Set the shape of the array in the given row.
00104   void setShape (uInt aRowNr, const IPosition& aShape);
00105   
00106   // Get the shape of the array in the given row.
00107   virtual IPosition shape (uInt aRowNr);
00108   
00109   // This storage manager can handle changing array shapes.
00110   Bool canChangeShape() const;
00111 
00112   // Is the shape defined (i.e. is there an array) in this row?
00113   virtual Bool isShapeDefined (uInt aRowNr);
00114 
00115   // Get the dimensionality of the item in the given row.
00116   virtual uInt ndim (uInt aRowNr);
00117 
00118 
00119 private:
00120   // Forbid copy constructor.
00121   SSMIndStringColumn (const SSMIndStringColumn&);
00122   
00123   // Forbid assignment.
00124   SSMIndStringColumn& operator= (const SSMIndStringColumn&);  
00125 };
00126 
00127 
00128 
00129 } //# NAMESPACE CASA - END
00130 
00131 #endif
00132 
00133 
00134 
00135