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
33namespace casacore { // # NAMESPACE CASACORE - BEGIN
34
35// <summary>
36// Class to specify which mask to use in an image.
37// </summary>
38
39// <use visibility=export>
40
41// <reviewed reviewer="" date="" tests="tPagedImage">
42// </reviewed>
43
44// <synopsis>
45// The only purpose of MaskSpecifier is to reduce the number of constructors
46// in PagedImage. It makes it possible to specify if no mask, the default
47// mask, or another mask should be used when opening an existing PagedImage
48// object.
49// <p>
50// Because the constructors automatically converts from a Bool or
51// a String, the user does not need to be aware of MaskSpecifier.
52// </synopsis>
53
54// <motivation>
55// The number of constructors in PagedImage would be many more
56// without this class. It would need one taking a Bool and a String.
57// Because C++ converts a const char* to Bool instead of String,
58// a const char* would also be needed multiple times.
59// </motivation>
60
61// # <todo asof="1997/11/11">
62// # <li>
63// # </todo>
64
66 public:
67 // Default constructor.
68 // It tells if the default mask should or no mask be used.
69 MaskSpecifier(Bool useDefaultMask = True) : itsFlag(useDefaultMask) {}
70
71 // Construct from a string.
72 // It tells to use an alternative mask. An empty name means no mask.
73 // # Note the const Char* constructor is needed, otherwise "name"
74 // # is converted to a Bool by the compiler.
75 // <group>
76 MaskSpecifier(const Char* maskName) : itsFlag(False), itsName(maskName) {}
77 MaskSpecifier(const String& maskName) : itsFlag(False), itsName(maskName) {}
78 // </group>
79
80 // Give the flag or name.
81 // <group>
82 Bool useDefault() const { return itsFlag; }
83 const String& name() const { return itsName; }
84 // </group>
85
86 private:
89};
90
91} // namespace casacore
92
93#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:355
For temporary backward namespace compatibility, use casa as alias for casacore.
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