casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ATMNumberDensity.h
Go to the documentation of this file.
1 #ifndef _ATM_NUMBERDENSITY_H
2 #define _ATM_NUMBERDENSITY_H
3 /*******************************************************************************
4  * ALMA - Atacama Large Millimiter Array
5  * (c) Instituto de Estructura de la Materia, 2009
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  *
21  * "@(#) $Id: ATMNumberDensity.h Exp $"
22  *
23  * who when what
24  * -------- -------- ----------------------------------------------
25  * pardo 24/03/09 created
26  */
27 
28 #ifndef __cplusplus
29 #error "This is a C++ include file and cannot be used from plain C"
30 #endif
31 
32 #include "ATMCommon.h"
33 #include <string>
34 
35 using std::string;
36 
38 
46 {
47  public:
49  NumberDensity();
51  NumberDensity(double numberdensity);
54  NumberDensity(double numberdensity, const string &units);
55 
57  virtual ~NumberDensity();
58 
60  double get() const { return valueIS_; }
62  double get(const string &units) const;
63 
64  NumberDensity& operator=(const NumberDensity &rhs) { if(&rhs != this) valueIS_ = rhs.valueIS_; return *this; }
65  NumberDensity& operator=(const double &rhs) { valueIS_ = rhs; return *this; }
68  NumberDensity operator*(double scf) { return NumberDensity(valueIS_ * scf); }
69  NumberDensity operator*(float scf) { return NumberDensity(valueIS_ * (double) scf); }
70  NumberDensity operator*(int scf) { return NumberDensity(valueIS_ * (double) scf); }
71  NumberDensity operator*(unsigned int scf) { return NumberDensity(valueIS_ * (double) scf); }
72  NumberDensity operator/(double scf) { return NumberDensity(valueIS_ / scf); }
73  NumberDensity operator/(float scf) { return NumberDensity(valueIS_ / (double) scf); }
74  NumberDensity operator/(int scf) { return NumberDensity(valueIS_ / (double) scf); }
75  NumberDensity operator/(unsigned int scf) { return NumberDensity(valueIS_ / (double) scf); }
76  bool operator<(const NumberDensity &rhs) const { return (valueIS_ < rhs.get()); }
77  bool operator>(const NumberDensity &rhs) const { return (valueIS_ > rhs.get()); }
78  bool operator<=(const NumberDensity &rhs) const { return (valueIS_ <= rhs.get()); }
79  bool operator>=(const NumberDensity &rhs) const { return (valueIS_ >= rhs.get()); }
80  bool operator==(const NumberDensity &rhs) const { return (valueIS_ == rhs.get()); }
81  bool operator!=(const NumberDensity &rhs) const { return (valueIS_ != rhs.get()); }
82 
83  private:
84  double valueIS_;
85 }; // class NumberDensity
86 
88 
89 #endif
#define ATM_NAMESPACE_END
Definition: ATMCommon.h:38
NumberDensity()
Default constructor.
NumberDensity operator/(int scf)
NumberDensity operator/(unsigned int scf)
NumberDensity operator/(double scf)
virtual ~NumberDensity()
Destructor.
bool operator!=(const NumberDensity &rhs) const
NumberDensity & operator=(const double &rhs)
bool operator>=(const NumberDensity &rhs) const
NumberDensity operator*(float scf)
bool operator==(const NumberDensity &rhs) const
NumberDensity & operator=(const NumberDensity &rhs)
#define ATM_NAMESPACE_BEGIN
Definition: ATMCommon.h:37
NumberDensity operator*(int scf)
bool operator>(const NumberDensity &rhs) const
NumberDensity operator/(float scf)
NumberDensity operator-(const NumberDensity &rhs)
NumberDensity operator+(const NumberDensity &rhs)
bool operator<=(const NumberDensity &rhs) const
Number Density value with units.
NumberDensity operator*(unsigned int scf)
bool operator<(const NumberDensity &rhs) const
double get() const
Accessor to the numberdensity value in International System units (K)
NumberDensity operator*(double scf)