source: trunk/src/MSWriterWrapper.h@ 3147

Last change on this file since 3147 was 3106, checked in by Takeshi Nakazato, 8 years ago

New Development: No

JIRA Issue: No

Ready for Test: Yes/No

Interface Changes: Yes/No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No

Module(s): Module Names change impacts.

Description: Describe your changes here...


Check-in asap modifications from Jim regarding casacore namespace conversion.

File size: 1.3 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#include "GILHandler.h"
27
28namespace asap
29{
30
31class MSWriterWrapper
32{
33public:
34 explicit MSWriterWrapper( ScantableWrapper tbl )
35 : writer_( 0 )
36 { stable_ = tbl.getCP() ; }
37
38 virtual ~MSWriterWrapper() {}
39
40 void write(const std::string& filename, const casacore::Record& rec)
41 {
42 GILHandler scopedRelease;
43
44 casacore::File file( filename ) ;
45 writer_ = new MSWriter( stable_ ) ;
46 if ( writer_->write( filename, rec ) ) {
47 return ;
48 }
49 else {
50 throw casacore::AipsError( "Failed to write data" ) ;
51 }
52 }
53
54private:
55
56 MSWriterWrapper() ;
57 MSWriterWrapper(const MSWriterWrapper&) ;
58 MSWriterWrapper& operator=(const MSWriterWrapper&) ;
59
60 casacore::CountedPtr<MSWriter> writer_ ;
61 casacore::CountedPtr<Scantable> stable_ ;
62};
63
64
65};
66#endif
Note: See TracBrowser for help on using the repository browser.