DataBuilder.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 DATABUILDER_H
00008 #define DATABUILDER_H
00009 
00010 #include <string>
00011 
00012 #include "FitsFile.h"
00013 #include "Logger.h"
00014 #include "MyException.h"
00015 #include "TableData.hxx"
00016 //-----------------------------------------------------------------------------
00019 class DataBuilderException : public MyException
00020 {
00021  public:
00023   DataBuilderException(const std::string& aMsg)
00024     : MyException("DataBuilderException: ", aMsg) { }
00025 };
00026 //-----------------------------------------------------------------------------
00032 // Carry out initial builds of data tables from FITS files
00033 template<typename DataType>
00034 class DataBuilder
00035 {
00036 public:
00038   DataBuilder()
00039   {
00040     builderName = "Unspecified DataBuilder";
00041   }
00042 
00044   virtual ~DataBuilder() {}
00045 
00046   const std::string& getName() const
00047   {
00048     return builderName;
00049   }
00050 
00052   void logInfo(const std::string& aTableName)
00053   {
00054     Logger log;
00055     log.addMessage("Instantiated builder '" + builderName + "' for table: "
00056                    + aTableName);
00057   }
00058 
00067   virtual TableData<DataType>* build(FitsFile& fpix,
00068                                      FitsFile& fcat,
00069                                            int fileNo) = 0;
00070 
00071 protected:
00072   std::string builderName;
00073 };
00074 //-----------------------------------------------------------------------------
00075 #endif
00076 //-----------------------------------------------------------------------------
00077 // Change log:
00078 //
00079 // 27-May-2004,  IAB: Original version.
00080 // 15-Mar-2006,  RSC: Moved logBuilderInfo() from MakeCSV.hxx to become a
00081 //                    method of this class
Generated on Mon Oct 4 10:38:34 2010 for WfcamSrc by  doxygen 1.6.3