source: branches/hpc33/src/MSWriterWrapper.h@ 2396

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

New Development: Yes

JIRA Issue: Yes CAS-2718

Ready for Test: Yes

Interface Changes: Yes

What Interface Changed: New class msfiller and mswriter added

Test Programs: List test programs

Put in Release Notes: No

Module(s): Module Names change impacts.

Description: Describe your changes here...

New filler/writer specific for Scantable-MS conversion defined.
This is not called from scantable constructor right now.
However, you can call it by explicitly importing msfiller/mswriter.


File size: 1.2 KB
Line 
1//
2// C++ Interface: MSWriterWrapper
3//
4// Description:
5//
6// This class is wrapper class for MSFiller
7//
8// Author: Takeshi Nakazato <takeshi.nakazato@nao.ac.jp>, (C) 2010
9//
10// Copyright: See COPYING file that comes with this distribution
11//
12//
13#ifndef ASAPMSWRITER_WRAPPER_H
14#define ASAPMSWRITER_WRAPPER_H
15
16#include <casa/aips.h>
17#include <casa/Exceptions.h>
18#include <casa/Utilities/CountedPtr.h>
19#include <casa/Containers/Record.h>
20#include <casa/OS/File.h>
21
22#include <string>
23
24#include "ScantableWrapper.h"
25#include "MSWriter.h"
26
27namespace asap
28{
29
30class MSWriterWrapper
31{
32public:
33 explicit MSWriterWrapper( ScantableWrapper tbl )
34 : writer_( 0 )
35 { stable_ = tbl.getCP() ; }
36
37 virtual ~MSWriterWrapper() {}
38
39 void write(const std::string& filename, const casa::Record& rec)
40 {
41 casa::File file( filename ) ;
42 writer_ = new MSWriter( stable_ ) ;
43 if ( writer_->write( filename, rec ) ) {
44 return ;
45 }
46 else {
47 throw casa::AipsError( "Failed to write data" ) ;
48 }
49 }
50
51private:
52
53 MSWriterWrapper() ;
54 MSWriterWrapper(const MSWriterWrapper&) ;
55 MSWriterWrapper& operator=(const MSWriterWrapper&) ;
56
57 casa::CountedPtr<MSWriter> writer_ ;
58 casa::CountedPtr<Scantable> stable_ ;
59};
60
61
62};
63#endif
Note: See TracBrowser for help on using the repository browser.