casacore
Loading...
Searching...
No Matches
MaskSpecifier.h
Go to the documentation of this file.
1//# MaskSpecifier.h: Class to specify which mask to use in an image
2//# Copyright (C) 1999
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#ifndef IMAGES_MASKSPECIFIER_H
27#define IMAGES_MASKSPECIFIER_H
28
29//# Includes
30#include <casacore/casa/aips.h>
31#include <casacore/casa/BasicSL/String.h>
32
33
34namespace casacore { //# NAMESPACE CASACORE - BEGIN
35
36// <summary>
37// Class to specify which mask to use in an image.
38// </summary>
39
40// <use visibility=export>
41
42// <reviewed reviewer="" date="" tests="tPagedImage">
43// </reviewed>
44
45// <synopsis>
46// The only purpose of MaskSpecifier is to reduce the number of constructors
47// in PagedImage. It makes it possible to specify if no mask, the default
48// mask, or another mask should be used when opening an existing PagedImage
49// object.
50// <p>
51// Because the constructors automatically converts from a Bool or
52// a String, the user does not need to be aware of MaskSpecifier.
53// </synopsis>
54
55// <motivation>
56// The number of constructors in PagedImage would be many more
57// without this class. It would need one taking a Bool and a String.
58// Because C++ converts a const char* to Bool instead of String,
59// a const char* would also be needed multiple times.
60// </motivation>
61
62//# <todo asof="1997/11/11">
63//# <li>
64//# </todo>
65
66
68{
69public:
70 // Default constructor.
71 // It tells if the default mask should or no mask be used.
72 MaskSpecifier (Bool useDefaultMask = True)
73 : itsFlag(useDefaultMask) {}
74
75 // Construct from a string.
76 // It tells to use an alternative mask. An empty name means no mask.
77 //# Note the const Char* constructor is needed, otherwise "name"
78 //# is converted to a Bool by the compiler.
79 // <group>
80 MaskSpecifier (const Char* maskName)
81 : itsFlag(False), itsName(maskName) {}
82 MaskSpecifier (const String& maskName)
83 : itsFlag(False), itsName(maskName) {}
84 // </group>
85
86 // Give the flag or name.
87 // <group>
89 { return itsFlag; }
90 const String& name() const
91 { return itsName; }
92 // </group>
93
94
95private:
98};
99
100
101
102} //# NAMESPACE CASACORE - END
103
104#endif
MaskSpecifier(Bool useDefaultMask=True)
Default constructor.
const String & name() const
MaskSpecifier(const Char *maskName)
Construct from a string.
Bool useDefault() const
Give the flag or name.
MaskSpecifier(const String &maskName)
String: the storage and methods of handling collections of characters.
Definition String.h:223
this file contains all the compiler specific defines
Definition mainpage.dox:28
const Bool False
Definition aipstype.h:42
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
const Bool True
Definition aipstype.h:41
char Char
Definition aipstype.h:44