NullTable.h

Go to the documentation of this file.
00001 //# NullTable.h: Class indicating a null Table object
00002 //# Copyright (C) 2001,2002,2003
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$
00027 
00028 #ifndef TABLES_NULLTABLE_H
00029 #define TABLES_NULLTABLE_H
00030 
00031 
00032 //# Includes
00033 #include <casacore/casa/aips.h>
00034 #include <casacore/tables/Tables/BaseTable.h>
00035 
00036 
00037 namespace casacore { //# NAMESPACE CASACORE - BEGIN
00038 
00039 // <summary>
00040 // Class indicating a null Table object
00041 // </summary>
00042 
00043 // <use visibility=local>
00044 
00045 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
00046 // </reviewed>
00047 
00048 // <prerequisite>
00049 //# Classes you should understand before using this one.
00050 //   <li> <linkto class=BaseTable>BaseTable</linkto>
00051 // </prerequisite>
00052 
00053 // <etymology>
00054 // NullTable represents a null table object, i.e. a Table object without
00055 // an underlying table..
00056 // </etymology>
00057 
00058 // <synopsis> 
00059 // Nullable is used to represent a null table.
00060 // The default Table constructor used to a create a null pointer
00061 // which results in core dumps when the Table object is actually used.
00062 // The NullTable object makes it possible to catch such cases
00063 // and throw an appropriate exception.
00064 // </synopsis> 
00065 
00066 
00067 class NullTable : public BaseTable
00068 {
00069 public:
00070   // Default constructor.
00071   NullTable();
00072 
00073   virtual ~NullTable();
00074 
00075   // The table is a null table.
00076   virtual Bool isNull() const;
00077 
00078   // All functions throw a "null table" exception.
00079   // <group>
00080   virtual void reopenRW();
00081   virtual Bool asBigEndian() const;
00082   virtual const StorageOption& storageOption() const;
00083   virtual Bool isMultiUsed (Bool checkSubTable) const;
00084   virtual const TableLock& lockOptions() const;
00085   virtual void mergeLock (const TableLock& lockOptions);
00086   virtual Bool hasLock (FileLocker::LockType) const;
00087   virtual Bool lock (FileLocker::LockType, uInt nattempts);
00088   virtual void unlock();
00089   virtual void flush (Bool fsync, Bool recursive);
00090   virtual void resync();
00091   virtual uInt getModifyCounter() const;
00092   virtual Bool isWritable() const;
00093   virtual void deepCopy (const String& newName,
00094                          const Record& dataManagerInfo,
00095                          const StorageOption&,
00096                          int tableOption,
00097                          Bool valueCopy,
00098                          int endianFormat,
00099                          Bool noRows) const;
00100   virtual TableDesc actualTableDesc() const;
00101   virtual Record dataManagerInfo() const;
00102   virtual TableRecord& keywordSet();
00103   virtual TableRecord& rwKeywordSet();
00104   virtual BaseColumn* getColumn (uInt columnIndex) const;
00105   virtual BaseColumn* getColumn (const String& columnName) const;
00106   virtual Bool canAddRow() const;
00107   virtual void addRow (uInt nrrow, Bool initialize);
00108   virtual Bool canRemoveRow() const;
00109   virtual void removeRow (uInt rownr);
00110   virtual DataManager* findDataManager (const String& name,
00111                                         Bool byColumn) const;
00112   virtual void addColumn (const ColumnDesc& columnDesc, Bool addToParent);
00113   virtual void addColumn (const ColumnDesc& columnDesc,
00114                           const String& dataManager, Bool byName,
00115                           Bool addToParent);
00116   virtual void addColumn (const ColumnDesc& columnDesc,
00117                           const DataManager& dataManager, Bool addToParent);
00118   virtual void addColumn (const TableDesc& tableDesc,
00119                           const DataManager& dataManager, Bool addToParent);
00120   virtual Bool canRemoveColumn (const Vector<String>& columnNames) const;
00121   virtual void removeColumn (const Vector<String>& columnNames);
00122   virtual Bool canRenameColumn (const String& columnName) const;
00123   virtual void renameColumn (const String& newName, const String& oldName);
00124   virtual void renameHypercolumn (const String& newName,
00125                                     const String& oldName);
00126   virtual Vector<uInt> rowNumbers() const;
00127   virtual BaseTable* root();
00128   virtual Bool rowOrder() const;
00129   virtual Vector<uInt>* rowStorage();
00130   virtual Bool adjustRownrs (uInt nrrow, Vector<uInt>& rownrs,
00131                              Bool determineOrder) const;
00132   virtual BaseTable* doSort (PtrBlock<BaseColumn*>&,
00133                              const Block<CountedPtr<BaseCompare> >&,
00134                              const Block<Int>& sortOrder,
00135                              int sortOption);
00136   virtual void renameSubTables (const String& newName,
00137                                 const String& oldName);
00138   // </group>
00139 
00140 private:
00141   // Copy constructor is forbidden, because copying a table requires
00142   // some more knowledge (like table name of result).
00143   // Declaring it private, makes it unusable.
00144   NullTable (const NullTable&);
00145 
00146   // Assignment is forbidden, because copying a table requires
00147   // some more knowledge (like table name of result).
00148   // Declaring it private, makes it unusable.
00149   NullTable& operator= (const NullTable&);
00150 
00151   // Throw an exception with the name of the function.
00152   void throwError (const String& name) const;
00153 };
00154 
00155 
00156 
00157 
00158 } //# NAMESPACE CASACORE - END
00159 
00160 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1