00001
00002
00003
00004
00005
00006
00007 #ifndef FILENAME_H
00008 #define FILENAME_H
00009
00010 #include <string>
00011
00012 #include "DataMethod.hxx"
00013 #include "FitsFile.h"
00014 #include "Options.h"
00015
00017 template<typename DataType>
00018 class FileName : public DataMethod<DataType>
00019 {
00020 public:
00022 FileName(const FitsFile& aFile)
00023 {
00024 DataMethod<DataType>::methodName = "FileName";
00025 Options options;
00026 mFileName = options.getServerName() + ":" + aFile.getFileName();
00027 }
00028
00030 virtual ~FileName() { }
00031
00033 void setSource(IntMap& tbls, IntMap& cols, StringMap units) { }
00034
00036 void setTarget(IntMap& cols, StringMap units)
00037 {
00038 colNo = cols[0];
00039 }
00040
00042 void doit(TableData<DataType>& data, int row1, int row2)
00043 {
00044 for (int rowNo = row1; rowNo < row2; ++rowNo)
00045 {
00046 data.assign(colNo, rowNo, mFileName);
00047 }
00048 }
00049
00050
00051 void doit2(TableData<DataType>& rawData, TableData<DataType>& data, int row1, int row2) { }
00052
00053 private:
00054 int colNo;
00055 std::string mFileName;
00056 };
00057
00058 #endif
00059
00060
00061
00062
00063