]> SALOME platform Git repositories - modules/med.git/blob - src/MEDMEM/MEDMEM_Unit.hxx
Salome HOME
Fix problem of make distcheck
[modules/med.git] / src / MEDMEM / MEDMEM_Unit.hxx
1 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 /*
24  File Unit.hxx
25  $Header$
26 */
27
28 #ifndef UNIT_HXX
29 #define UNIT_HXX
30
31 #include <MEDMEM.hxx>
32
33 #include <string>
34
35 #include "MEDMEM_Utilities.hxx"
36 #include "MEDMEM_Exception.hxx"
37 #include "MEDMEM_define.hxx"
38
39 namespace MEDMEM {
40 class MEDMEM_EXPORT UNIT { 
41 protected:
42   string _name ;
43   string _description ;
44
45   int    _masse ; // kilogram (kg)
46   int    _length ; // meter (m)
47   int    _time ; // second (s)
48   int    _temperature ; // Kelvin (K)
49   int    _matterQuantity ; // mole (mol)
50   int    _currentStrength ; // ampere (A)
51   int    _lightIntensity ; // candela (cd)
52
53   // Unit in IS !
54   // Example : 
55   //   J = kg.m^2.s^(-2) 
56   //   so : Name="Joule",Masse=1,Length=2 and Time=-2, other are null 
57
58 public:
59   UNIT();
60   UNIT(string Name, string Description);
61   ~UNIT();
62   UNIT & operator=(const UNIT &unit);
63
64   inline void setName(string Name) ;
65   inline void setDescription(string Description) ;
66   inline void setMasse(int Masse) ;
67   inline void setLength(int Length) ;
68   inline void setTime(int Time) ;
69   inline void setTemperature(int Temperature) ;
70   inline void setMatterQuantity(int MatterQuantity) ;
71   inline void setCurrentStrength(int CurrentStrength) ;
72   inline void setLightIntensity(int LightIntensity) ;
73
74   inline string getName() const ;
75   inline string getDescription() const ;
76   inline int    getMasse() const ;
77   inline int    getLength() const ;
78   inline int    getTime() const ;
79   inline int    getTemperature() const ;
80   inline int    getMatterQuantity() const ;
81   inline int    getCurrentStrength() const ;
82   inline int    getLightIntensity() const ;
83
84 } ;
85
86 // inline method :
87
88 inline void UNIT::setName(string Name) {
89   _name = Name ;
90 }
91 inline void UNIT::setDescription(string Description) {
92   _description = Description ;
93 }
94 inline void UNIT::setMasse(int Masse) {
95   _masse=Masse ;
96 }
97 inline void UNIT::setLength(int Length) {
98   _length=Length ;
99 }
100 inline void UNIT::setTime(int Time) {
101   _time=Time ;
102 }
103 inline void UNIT::setTemperature(int Temperature) {
104   _temperature=Temperature ;
105 }
106 inline void UNIT::setMatterQuantity(int MatterQuantity) {
107   _matterQuantity=MatterQuantity ;
108 }
109 inline void UNIT::setCurrentStrength(int CurrentStrength) {
110   _currentStrength=CurrentStrength ;
111 }
112 inline void UNIT::setLightIntensity(int LightIntensity) {
113   _lightIntensity=LightIntensity ;
114 }
115
116 inline string UNIT::getName() const            { return _name ; }
117 inline string UNIT::getDescription() const     { return _description ; }
118 inline int    UNIT::getMasse() const           { return _masse ; }
119 inline int    UNIT::getLength() const          { return _length ; }
120 inline int    UNIT::getTime() const            { return _time ; }
121 inline int    UNIT::getTemperature() const     { return _temperature ; }
122 inline int    UNIT::getMatterQuantity() const  { return _matterQuantity ; }
123 inline int    UNIT::getCurrentStrength() const { return _currentStrength ; }
124 inline int    UNIT::getLightIntensity() const  { return _lightIntensity ; }
125 }//End namespace MEDMEM
126
127 #endif /* UNIT_HXX */