Primary.hxx

Go to the documentation of this file.
00001 
00002 
00003 
00004 //-----------------------------------------------------------------------------
00005 // CVS: $Revision: 2099 $, $Date: 2006-04-17 17:48:43 +0100 (Mon, 17 Apr 2006) $, $Author: rsc $
00006 //-----------------------------------------------------------------------------
00007 #ifndef PRIMARY_H
00008 #define PRIMARY_H
00009 
00010 #include "DataBuilder.hxx"
00011 #include "InsertData.hxx"
00012 #include "TableInfo.h"
00013 //-----------------------------------------------------------------------------
00018 template<typename DataType>
00019 class Primary : public DataBuilder<DataType>
00020 {
00021 public:
00023   Primary(const TableInfo& aInfo)
00024     : mInfo(aInfo)
00025     { DataBuilder<DataType>::builderName = "Primary"; }
00026 
00028   virtual ~Primary() {}
00029 
00031   TableData<DataType>* build(FitsFile& fpix, FitsFile& fcat, int fileNo)
00032   {
00033     int numCols = mInfo.getNumAttributes();
00034     TableData<DataType> *data = new TableData<DataType>(numCols, 1);
00035 
00036     // Grab primary fits header
00037     insertFitsPrimaryHeader(0, fpix, mInfo, *data);
00038 
00039     // Grab stuff from first extension header. This could be modified
00040     // to search all extension HDUs
00041     fpix.movabsHdu(2);
00042     insertFitsExtensionHeader(0, fpix, mInfo, *data);
00043 
00044     return data;
00045   }
00046 
00047 private:
00048   TableInfo mInfo;
00049 };
00050 //-----------------------------------------------------------------------------
00051 #endif
00052 //-----------------------------------------------------------------------------
00053 // Change log:
00054 //
00055 // 27-May-2004,  IAB: Original version.
Generated on Mon Oct 4 10:38:34 2010 for WfcamSrc by  doxygen 1.6.3