Changeset 1786
- Timestamp:
- 07/30/10 16:33:06 (14 years ago)
- Location:
- branches/newfiller/src
- Files:
-
- 1 added
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/newfiller/src/FillerBase.cpp
r1780 r1786 17 17 using namespace casa; 18 18 19 namespace asap 20 { 21 FillerBase::FillerBase( ) :22 table_( 0)19 namespace asap { 20 21 FillerBase::FillerBase(casa::CountedPtr<Scantable> stable) : 22 table_(stable) 23 23 { 24 24 } -
branches/newfiller/src/FillerBase.h
r1780 r1786 40 40 { 41 41 public: 42 FillerBase(); 43 FillerBase(casa::CountedPtr<Scantable> stable); 42 explicit FillerBase(casa::CountedPtr<Scantable> stable); 44 43 virtual ~FillerBase(); 45 44 45 // virtual bool open(const std::string& filename, const Record& rec)=0; 46 46 virtual bool open(const std::string& filename)=0; 47 47 virtual void fill() = 0; 48 48 virtual void close() = 0; 49 50 void setReferenceRegex(const std::string& rx) { referenceRx_ = rx; } 51 49 52 50 53 protected: -
branches/newfiller/src/FillerWrapper.h
r1781 r1786 14 14 15 15 #include <casa/aips.h> 16 #include <casa/Exceptions.h> 16 17 #include <casa/Utilities/CountedPtr.h> 17 18 #include <string> 18 19 20 #include "ScantableWrapper.h" 21 #include "FillerBase.h" 22 /* 23 #include "PKSFiller.h" 24 #include "NROFiller.h" 25 */ 26 19 27 namespace asap 20 28 { 21 class Filler 29 class FillerWrapper 22 30 { 23 31 public: 24 Filler() : filler_p(0) {;};25 32 26 ~Filler() { close(); };33 FillerWrapper() : filler_(0), attached_(false), stable_(0) {;} 27 34 35 FillerWrapper(ScantableWrapper tbl) : filler_(0), attached_(false) 36 { stable_ = tbl.getCP(); } 37 38 virtual ~FillerWrapper() { close(); } 39 40 41 // void open(const std::string& filename, casa::Record rec) { 28 42 void open(const std::string& filename) { 29 filler_p = new ATFiller(); 30 if (filler_p->open(filename)) { 43 // filler_ = new ATFiller(stable_); 44 // if (filler_->open(filename, rec)) { 45 if (filler_->open(filename)) { 46 attached_ = true; 31 47 return; 32 48 } 33 filler_p = new NROFiller(); 34 if (filler_p->open(filename)) { 49 // filler_ = new NROFiller(stable_); 50 // if (filler_->open(filename, rec)) { 51 if (filler_->open(filename)) { 52 attached_ = true; 35 53 return; 36 54 } 37 throw AipsError("Unknown Data Format"); 55 filler_ = 0; 56 attached_ = false; 57 throw casa::AipsError("Unknown Data Format"); 38 58 } 39 59 void close() { 40 if ( filler_p) {41 filler_ p->close();60 if (attached_) { 61 filler_->close(); 42 62 } 43 63 } 44 64 45 65 void fill() { 46 if ( filler_p) {47 filler_ p->fill();66 if (attached_) { 67 filler_->fill(); 48 68 } 49 69 } 50 void setReferenceRx(const std::string& rx) { 51 if (filler_p) { 52 filler_p->setReferenceRx(rx); 70 71 void setReferenceRegex(const std::string& rx) { 72 if (attached_) { 73 filler_->setReferenceRegex(rx); 53 74 } 54 75 } 55 76 56 77 private: 57 casa::CountedPtr<FillerBase> filler_p; 78 79 casa::CountedPtr<FillerBase> filler_; 80 bool attached_; 81 casa::CountedPtr<Scantable> stable_; 58 82 }; 59 83 60 61 84 }; 85 #endif
Note:
See TracChangeset
for help on using the changeset viewer.