source: branches/newfiller/src/Filler.h@ 1784

Last change on this file since 1784 was 1778, checked in by Malte Marquarding, 14 years ago

Initial untested Filler rewrite

File size: 990 bytes
Line 
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>
16#include <casa/Utilities/CountedPtr.h>
17#include <string>
18
19namespace asap
20{
21class Filler
22{
23public:
24 Filler() : filler_p(0) {;};
25
26 ~Filler() { close(); };
27
28 void open(const std::string& filename) {
29 filler_p = new ATFiller();
30 if (filler_p->open(filename)) {
31 return;
32 }
33 filler_p = new NROFiller();
34 if (filler_p->open(filename)) {
35 return;
36 }
37 throw AipsError("Unknown Data Format");
38 }
39 void close() {
40 if (filler_p) {
41 filler_p->close();
42 }
43 }
44
45 void fill() {
46 if (filler_p) {
47 filler_p->fill();
48 }
49 }
50 void setReferenceRx(const std::string& rx) {
51 if (filler_p) {
52 filler_p->setReferenceRx(rx);
53 }
54 }
55
56private:
57 casa::CountedPtr<FillerBase> filler_p;
58};
59
60
61};
Note: See TracBrowser for help on using the repository browser.