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