00001 /* 00002 * ProcessorRecord.h 00003 * 00004 * Created on: Jan 27, 2016 00005 * Author: nakazato 00006 */ 00007 00008 #ifndef SINGLEDISH_FILLER_PROCESSORRECORD_H_ 00009 #define SINGLEDISH_FILLER_PROCESSORRECORD_H_ 00010 00011 #include <casacore/casa/BasicSL/String.h> 00012 #include <casacore/ms/MeasurementSets/MSProcessor.h> 00013 #include <casacore/ms/MeasurementSets/MSProcessorColumns.h> 00014 00015 namespace casa { //# NAMESPACE CASA - BEGIN 00016 namespace sdfiller { //# NAMESPACE SDFILLER - BEGIN 00017 00018 struct ProcessorRecord { 00019 typedef MSProcessor AssociatingTable; 00020 typedef MSProcessorColumns AssociatingColumns; 00021 00022 // mandatory 00023 String type; 00024 String sub_type; 00025 Int type_id; 00026 Int mode_id; 00027 00028 // method 00029 void clear() { 00030 type = ""; 00031 sub_type = ""; 00032 type_id = -1; 00033 mode_id = -1; 00034 } 00035 00036 ProcessorRecord &operator=(ProcessorRecord const &other) { 00037 type = other.type; 00038 sub_type = other.sub_type; 00039 type_id = other.type_id; 00040 mode_id = other.mode_id; 00041 return *this; 00042 } 00043 00044 void add(AssociatingTable &table, AssociatingColumns &/*columns*/) { 00045 table.addRow(1, True); 00046 } 00047 00048 Bool fill(uInt irow, AssociatingColumns &columns) { 00049 if (columns.nrow() <= irow) { 00050 return False; 00051 } 00052 00053 columns.type().put(irow, type); 00054 columns.subType().put(irow, sub_type); 00055 columns.typeId().put(irow, type_id); 00056 columns.modeId().put(irow, mode_id); 00057 00058 return True; 00059 } 00060 }; 00061 00062 } //# NAMESPACE SDFILLER - END 00063 } //# NAMESPACE CASA - END 00064 00065 #endif /* SINGLEDISH_FILLER_PROCESSORRECORD_H_ */