source: branches/newfiller/src/FillerWrapper.h @ 1794

Last change on this file since 1794 was 1794, checked in by Takeshi Nakazato, 14 years ago

Uncommented include NROFiller

File size: 1.6 KB
RevLine 
[1778]1//
2// C++ Interface: Filler
3//
4// Description:
5//
6//
7// Author: Malte Marquarding <asap@atnf.csiro.au>, (C) 2010
8//
9// Copyright: See COPYING file that comes with this distribution
10//
11//
12#ifndef ASAPFILLER_H
13#define ASAPFILLER_H
14
15#include <casa/aips.h>
[1786]16#include <casa/Exceptions.h>
[1778]17#include <casa/Utilities/CountedPtr.h>
18#include <string>
19
[1786]20#include "ScantableWrapper.h"
21#include "FillerBase.h"
22/*
23#include "PKSFiller.h"
[1794]24*/
[1786]25#include "NROFiller.h"
26
[1794]27
[1778]28namespace asap
29{
[1786]30class FillerWrapper
[1778]31{
32public:
33
[1787]34  explicit FillerWrapper(ScantableWrapper tbl) : filler_(0), attached_(false)
[1786]35  { stable_ = tbl.getCP(); }
36
37  virtual ~FillerWrapper() { close(); }
38
39
40//  void open(const std::string& filename, casa::Record rec) {
[1778]41  void open(const std::string& filename) {
[1786]42//    filler_ = new ATFiller(stable_);
43//    if (filler_->open(filename, rec)) {
44    if (filler_->open(filename)) {
45      attached_ = true;
[1778]46      return;
47    }
[1792]48    filler_ = new NROFiller(stable_);
[1786]49//    if (filler_->open(filename, rec)) {
50    if (filler_->open(filename)) {
51      attached_ = true;
[1778]52      return;
53    }
[1786]54    filler_ = 0;
55    attached_ = false;
56    throw casa::AipsError("Unknown Data Format");
[1778]57  }
58  void close() {
[1786]59    if (attached_) {
60      filler_->close();
[1778]61    }
62  }
63
64  void fill() {
[1786]65    if (attached_) {
66      filler_->fill();
[1778]67    }
68  }
[1786]69
70  void setReferenceRegex(const std::string& rx) {
71    if (attached_) {
72      filler_->setReferenceRegex(rx);
[1778]73    }
74  }
75
76private:
[1786]77
[1787]78  FillerWrapper() {;}
79  FillerWrapper(const FillerWrapper& other) {;}
80
[1786]81  casa::CountedPtr<FillerBase> filler_;
82  bool attached_;
83  casa::CountedPtr<Scantable> stable_;
[1778]84};
85
86};
[1786]87#endif
Note: See TracBrowser for help on using the repository browser.