casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ReaderInterface.h
Go to the documentation of this file.
1 /*
2  * ReaderInterface.h
3  *
4  * Created on: Jan 5, 2016
5  * Author: nakazato
6  */
7 
8 #ifndef SINGLEDISH_FILLER_READERINTERFACE_H_
9 #define SINGLEDISH_FILLER_READERINTERFACE_H_
10 
11 // std includes
12 #include <string>
13 
21 
30 
31 namespace casa { //# NAMESPACE CASA - BEGIN
32 
33 // forward declaration
34 template<class T> class NullOptionalTables;
35 
36 // NonCopyable Mixin (CRTP)
37 template<class T>
38 class NonCopyable {
39 protected:
41  }
43  }
44 private:
46  }
47  T &operator=(T const &) {
48  }
49 };
50 
51 class ReaderInterface: private NonCopyable<ReaderInterface> {
52 public:
54 
55  ReaderInterface(std::string const &name) :
56  name_(name) {
57  }
58 
59  virtual ~ReaderInterface() {
60  }
61 
62  std::string const &getName() const {
63  return name_;
64  }
65 
66  virtual casacore::String getDataUnit() const {
67  return "";
68  }
69 
70  virtual casacore::Bool isFloatData() const {
71  return false;
72  }
73 
76  }
77 
78  void initialize() {
81  }
82 
83  void finalize() {
86  }
87 
88  // get number of rows for MAIN table
89  virtual size_t getNumberOfRows() = 0;
90 
91  // to get OBSERVATION table
92  // The method should return true if row entry is available.
93  // If it return false, row will be invalid so it should not be used.
95 
96  // to get ANTENNA table
97  // The method should return true if row entry is available.
98  // If it return false, row will be invalid so it should not be used.
100 
101  // to get PROCESSOR table
102  // The method should return true if row entry is available.
103  // If it return false, row will be invalid so it should not be used.
105 
106  // to get SOURCE table
107  // The method should return true if row entry is available.
108  // If it return false, row will be invalid so it should not be used.
110 
111  // to get FIELD table
112  // The method should return true if row entry is available.
113  // If it return false, row will be invalid so it should not be used.
115 
116  // to get SPECTRAL WINDOW table
117  // The method should return true if row entry is available.
118  // If it return false, row will be invalid so it should not be used.
120 
121  // for DataAccumulator
122  virtual casacore::Bool getData(size_t irow, sdfiller::DataRecord &record) = 0;
123 
124 protected:
125  virtual void initializeSpecific() = 0;
126  virtual void finalizeSpecific() = 0;
127 
128  std::string const name_;
129 
130 private:
131  // common initialization/finalization actions
133  }
134  void finalizeCommon() {
135  }
136 };
137 
138 // empty OptionalTables class
139 template<class Reader>
140 class NullOptionalTables {
141 public:
142  static void Generate(casacore::Table &/*table*/, Reader const &/*reader*/) {
143  //std::cout << "This is default. NullOptionalTables::Generate" << std::endl;
144  }
145 };
146 
147 } //# NAMESPACE CASA - END
148 
149 #endif /* SINGLEDISH_FILLER_READERINTERFACE_H_ */
virtual void finalizeSpecific()=0
NullOptionalTables< ReaderInterface > OptionalTables
void initializeCommon()
common initialization/finalization actions
Main interface class to a read/write table.
Definition: Table.h:153
NonCopyable Mixin (CRTP)
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
virtual casacore::Bool getSpectralWindowRow(sdfiller::SpectralWindowRecord &row)=0
to get SPECTRAL WINDOW table The method should return true if row entry is available.
Types
Types of known MDirections Warning: The order defines the order in the translation matrix FromTo in ...
Definition: MDirection.h:188
virtual casacore::Bool getData(size_t irow, sdfiller::DataRecord &record)=0
for DataAccumulator
virtual casacore::Bool getSourceRow(sdfiller::SourceRecord &row)=0
to get SOURCE table The method should return true if row entry is available.
virtual casacore::Bool getProcessorRow(sdfiller::ProcessorRecord &record)=0
to get PROCESSOR table The method should return true if row entry is available.
std::string const name_
virtual casacore::String getDataUnit() const
forward declaration
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
virtual size_t getNumberOfRows()=0
get number of rows for MAIN table
virtual casacore::MDirection::Types getDirectionFrame() const
static void Generate(casacore::Table &, Reader const &)
ReaderInterface(std::string const &name)
virtual casacore::Bool getObservationRow(sdfiller::ObservationRecord &record)=0
to get OBSERVATION table The method should return true if row entry is available. ...
NonCopyable(NonCopyable const &)
T & operator=(T const &)
String: the storage and methods of handling collections of characters.
Definition: String.h:223
virtual void initializeSpecific()=0
std::string const & getName() const
virtual casacore::Bool getFieldRow(sdfiller::FieldRecord &row)=0
to get FIELD table The method should return true if row entry is available.
virtual casacore::Bool getAntennaRow(sdfiller::AntennaRecord &record)=0
to get ANTENNA table The method should return true if row entry is available.
virtual casacore::Bool isFloatData() const