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

Last change on this file since 1790 was 1787, checked in by Malte Marquarding, 15 years ago

Make python wrapper noncopyable

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"
24#include "NROFiller.h"
25*/
26
[1778]27namespace asap
28{
[1786]29class FillerWrapper
[1778]30{
31public:
32
[1787]33 explicit FillerWrapper(ScantableWrapper tbl) : filler_(0), attached_(false)
[1786]34 { stable_ = tbl.getCP(); }
35
36 virtual ~FillerWrapper() { close(); }
37
38
39// void open(const std::string& filename, casa::Record rec) {
[1778]40 void open(const std::string& filename) {
[1786]41// filler_ = new ATFiller(stable_);
42// if (filler_->open(filename, rec)) {
43 if (filler_->open(filename)) {
44 attached_ = true;
[1778]45 return;
46 }
[1786]47// filler_ = new NROFiller(stable_);
48// if (filler_->open(filename, rec)) {
49 if (filler_->open(filename)) {
50 attached_ = true;
[1778]51 return;
52 }
[1786]53 filler_ = 0;
54 attached_ = false;
55 throw casa::AipsError("Unknown Data Format");
[1778]56 }
57 void close() {
[1786]58 if (attached_) {
59 filler_->close();
[1778]60 }
61 }
62
63 void fill() {
[1786]64 if (attached_) {
65 filler_->fill();
[1778]66 }
67 }
[1786]68
69 void setReferenceRegex(const std::string& rx) {
70 if (attached_) {
71 filler_->setReferenceRegex(rx);
[1778]72 }
73 }
74
75private:
[1786]76
[1787]77 FillerWrapper() {;}
78 FillerWrapper(const FillerWrapper& other) {;}
79
[1786]80 casa::CountedPtr<FillerBase> filler_;
81 bool attached_;
82 casa::CountedPtr<Scantable> stable_;
[1778]83};
84
85};
[1786]86#endif
Note: See TracBrowser for help on using the repository browser.