Salome HOME
update after merging trhe branches CEA_V3_0_x, OCC_V3_1_0_a1_x, and the main
[modules/med.git] / src / MEDMEM / MEDMEM_Unit.hxx
1 /*
2  File Unit.hxx
3  $Header$
4 */
5
6 #ifndef UNIT_HXX
7 #define UNIT_HXX
8
9 #include <string>
10
11 #include "MEDMEM_Utilities.hxx"
12 #include "MEDMEM_Exception.hxx"
13 #include "MEDMEM_define.hxx"
14
15 namespace MEDMEM {
16 class UNIT { 
17 protected:
18   string _name ;
19   string _description ;
20
21   int    _masse ; // kilogram (kg)
22   int    _length ; // meter (m)
23   int    _time ; // second (s)
24   int    _temperature ; // Kelvin (K)
25   int    _matterQuantity ; // mole (mol)
26   int    _currentStrength ; // ampere (A)
27   int    _lightIntensity ; // candela (cd)
28
29   // Unit in IS !
30   // Example : 
31   //   J = kg.m^2.s^(-2) 
32   //   so : Name="Joule",Masse=1,Length=2 and Time=-2, other are null 
33
34 public:
35   UNIT();
36   UNIT(string Name, string Description);
37   ~UNIT();
38   UNIT & operator=(const UNIT &unit);
39
40   inline void setName(string Name) ;
41   inline void setDescription(string Description) ;
42   inline void setMasse(int Masse) ;
43   inline void setLength(int Length) ;
44   inline void setTime(int Time) ;
45   inline void setTemperature(int Temperature) ;
46   inline void setMatterQuantity(int MatterQuantity) ;
47   inline void setCurrentStrength(int CurrentStrength) ;
48   inline void setLightIntensity(int LightIntensity) ;
49
50   inline string getName() const ;
51   inline string getDescription() const ;
52   inline int    getMasse() const ;
53   inline int    getLength() const ;
54   inline int    getTime() const ;
55   inline int    getTemperature() const ;
56   inline int    getMatterQuantity() const ;
57   inline int    getCurrentStrength() const ;
58   inline int    getLightIntensity() const ;
59
60 } ;
61
62 // inline method :
63
64 inline void UNIT::setName(string Name) {
65   _name = Name ;
66 };
67 inline void UNIT::setDescription(string Description) {
68   _description = Description ;
69 };
70 inline void UNIT::setMasse(int Masse) {
71   _masse=Masse ;
72 };
73 inline void UNIT::setLength(int Length) {
74   _length=Length ;
75 };
76 inline void UNIT::setTime(int Time) {
77   _time=Time ;
78 };
79 inline void UNIT::setTemperature(int Temperature) {
80   _temperature=Temperature ;
81 };
82 inline void UNIT::setMatterQuantity(int MatterQuantity) {
83   _matterQuantity=MatterQuantity ;
84 };
85 inline void UNIT::setCurrentStrength(int CurrentStrength) {
86   _currentStrength=CurrentStrength ;
87 };
88 inline void UNIT::setLightIntensity(int LightIntensity) {
89   _lightIntensity=LightIntensity ;
90 };
91
92 inline string UNIT::getName() const            { return _name ; } ;
93 inline string UNIT::getDescription() const     { return _description ; } ;
94 inline int    UNIT::getMasse() const           { return _masse ; } ;
95 inline int    UNIT::getLength() const          { return _length ; } ;
96 inline int    UNIT::getTime() const            { return _time ; } ;
97 inline int    UNIT::getTemperature() const     { return _temperature ; } ;
98 inline int    UNIT::getMatterQuantity() const  { return _matterQuantity ; } ;
99 inline int    UNIT::getCurrentStrength() const { return _currentStrength ; } ;
100 inline int    UNIT::getLightIntensity() const  { return _lightIntensity ; } ;
101 }//End namespace MEDMEM
102
103 #endif /* UNIT_HXX */