Line data Source code
1 : /* 2 : * ProcessorRecord.h 3 : * 4 : * Created on: Jan 27, 2016 5 : * Author: nakazato 6 : */ 7 : 8 : #ifndef SINGLEDISH_FILLER_PROCESSORRECORD_H_ 9 : #define SINGLEDISH_FILLER_PROCESSORRECORD_H_ 10 : 11 : #include <casacore/casa/BasicSL/String.h> 12 : #include <casacore/ms/MeasurementSets/MSProcessor.h> 13 : #include <casacore/ms/MeasurementSets/MSProcessorColumns.h> 14 : 15 : namespace casa { //# NAMESPACE CASA - BEGIN 16 : namespace sdfiller { //# NAMESPACE SDFILLER - BEGIN 17 : 18 : struct ProcessorRecord { 19 : typedef casacore::MSProcessor AssociatingTable; 20 : typedef casacore::MSProcessorColumns AssociatingColumns; 21 : 22 : // mandatory 23 : casacore::String type; 24 : casacore::String sub_type; 25 : casacore::Int type_id; 26 : casacore::Int mode_id; 27 : 28 : // method 29 14 : void clear() { 30 14 : type = ""; 31 14 : sub_type = ""; 32 14 : type_id = -1; 33 14 : mode_id = -1; 34 14 : } 35 : 36 : ProcessorRecord &operator=(ProcessorRecord const &other) { 37 : type = other.type; 38 : sub_type = other.sub_type; 39 : type_id = other.type_id; 40 : mode_id = other.mode_id; 41 : return *this; 42 : } 43 : 44 7 : void add(AssociatingTable &table, AssociatingColumns &/*columns*/) { 45 7 : table.addRow(1, true); 46 7 : } 47 : 48 7 : casacore::Bool fill(casacore::uInt irow, AssociatingColumns &columns) { 49 7 : if (columns.nrow() <= irow) { 50 0 : return false; 51 : } 52 : 53 7 : columns.type().put(irow, type); 54 7 : columns.subType().put(irow, sub_type); 55 7 : columns.typeId().put(irow, type_id); 56 7 : columns.modeId().put(irow, mode_id); 57 : 58 7 : return true; 59 : } 60 : }; 61 : 62 : } //# NAMESPACE SDFILLER - END 63 : } //# NAMESPACE CASA - END 64 : 65 : #endif /* SINGLEDISH_FILLER_PROCESSORRECORD_H_ */