casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
LELScalar.h
Go to the documentation of this file.
00001 //# LELScalar.h: Hold a scalar with a mask in LEL
00002 //# Copyright (C) 1999
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //# $Id: LELScalar.h 20229 2008-01-29 15:19:06Z gervandiepen $
00027 
00028 #ifndef LATTICES_LELSCALAR_H
00029 #define LATTICES_LELSCALAR_H
00030 
00031 
00032 //# Includes
00033 #include <casa/aips.h>
00034 
00035 
00036 namespace casa { //# NAMESPACE CASA - BEGIN
00037 
00038 // <summary>
00039 // This LEL class holds a scalar with a mask.
00040 // </summary>
00041 
00042 // <use visibility=local>
00043 
00044 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
00045 // </reviewed>
00046 
00047 // <synopsis>
00048 // This LEL class holds a scalar with a mask.
00049 // </synopsis>
00050 
00051 // <motivation>
00052 // It maskes it possible to handle a scalar with its mask as a single object.
00053 // </motivation>
00054 
00055 // <todo asof="1998/01/20">
00056 // </todo>
00057  
00058 
00059 template <class T> class LELScalar
00060 {
00061 public: 
00062 // Default constructor sets a False mask.
00063    LELScalar();
00064 
00065 // Constructor takes value and optional mask.
00066    LELScalar (const T& value, Bool mask=True)
00067       : itsValue (value), itsMask(mask) {}
00068 
00069 // Get value.
00070 // <group>
00071    const T& value() const
00072       { return itsValue; }
00073    T& value()
00074       { return itsValue; }
00075 // </group>
00076 
00077 // Get mask.
00078    Bool mask() const
00079       { return itsMask; }
00080 
00081 private:
00082    T    itsValue;
00083    Bool itsMask;
00084 };
00085 
00086 
00087 
00088 } //# NAMESPACE CASA - END
00089 
00090 #ifndef CASACORE_NO_AUTO_TEMPLATES
00091 #include <lattices/Lattices/LELScalar.tcc>
00092 #endif //# CASACORE_NO_AUTO_TEMPLATES
00093 #endif