Line data Source code
1 : //# AsciiRegionLine.h 2 : //# Copyright (C) 1998,1999,2000,2001 3 : //# Associated Universities, Inc. Washington DC, USA. 4 : //# 5 : //# This library is free software; you can redistribute it and/or modify it 6 : //# under the terms of the GNU Library General Public License as published by 7 : //# the Free Software Foundation; either version 2 of the License, or (at your 8 : //# option) any later version. 9 : //# 10 : //# This library is distributed in the hope that it will be useful, but WITHOUT 11 : //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 : //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 13 : //# License for more details. 14 : //# 15 : //# You should have received a copy of the GNU Library General Public License 16 : //# along with this library; if not, write to the Free Software Foundation, 17 : //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 18 : //# 19 : //# Correspondence concerning AIPS++ should be addressed as follows: 20 : //# Internet email: casa-feedback@nrao.edu. 21 : //# Postal address: AIPS++ Project Office 22 : //# National Radio Astronomy Observatory 23 : //# 520 Edgemont Road 24 : //# Charlottesville, VA 22903-2475 USA 25 : //# 26 : 27 : 28 : #ifndef IMAGES_ASCIIANNOTATIONFILELINE_H 29 : #define IMAGES_ASCIIANNOTATIONFILELINE_H 30 : 31 : #include <casacore/casa/aips.h> 32 : #include <imageanalysis/Annotations/AnnotationBase.h> 33 : #include <casacore/measures/Measures/Stokes.h> 34 : #include <casacore/casa/Utilities/CountedPtr.h> 35 : 36 : namespace casa { 37 : 38 : // <summary> 39 : // Represents a line in an ascii region file 40 : // </summary> 41 : // <author>Dave Mehringer</author> 42 : // <use visibility=export> 43 : // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos=""> 44 : // </reviewed> 45 : // <prerequisite> 46 : 47 : // </prerequisite> 48 : 49 : // <etymology> 50 : // Represents a line in an ascii region file 51 : // </etymology> 52 : 53 : // <synopsis> 54 : // Represents a line in an ascii region file 55 : // See the region file format proposal attached to CAS-2285 (https://bugs.nrao.edu/browse/CAS-2285) 56 : // </synopsis> 57 : 58 : class AsciiAnnotationFileLine { 59 : 60 : public: 61 : 62 : enum Type { 63 : ANNOTATION, 64 : COMMENT, 65 : GLOBAL, 66 : UNKNOWN_TYPE 67 : }; 68 : 69 : AsciiAnnotationFileLine(); 70 : 71 : AsciiAnnotationFileLine(const casacore::String& comment); 72 : 73 : AsciiAnnotationFileLine(casacore::CountedPtr<const AnnotationBase> annotationBase); 74 : 75 : AsciiAnnotationFileLine(const std::map<AnnotationBase::Keyword, casacore::String>& globals); 76 : 77 : AsciiAnnotationFileLine& operator= (const AsciiAnnotationFileLine& other); 78 : 79 : casacore::String getComment() const; 80 : 81 : std::map<AnnotationBase::Keyword, casacore::String> getGloabalParams() const; 82 : 83 : casacore::CountedPtr<const AnnotationBase> getAnnotationBase() const; 84 : 85 : Type getType() const; 86 : 87 : std::ostream& print(std::ostream& os) const; 88 : 89 : private: 90 : Type _type; 91 : casacore::String _comment; 92 : casacore::CountedPtr<const AnnotationBase> _annotationBase; 93 : std::map<AnnotationBase::Keyword, casacore::String> _globals; 94 : 95 : }; 96 : 97 0 : inline std::ostream &operator<<(std::ostream& os, const AsciiAnnotationFileLine& line) { 98 0 : return line.print(os); 99 : }; 100 : 101 : } 102 : 103 : #endif /* ASCIIREGIONLINE_H */