00001 #if !defined(UNITSEXTENSION_INCLUDED)
00002 #define UNITSEXTENSION_INCLUDED
00003
00004
00005 #include <string>
00006 #include <vector>
00007 #include "GaudiKernel/StatusCode.h"
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 class UnitsObject {
00023 private:
00024 std::string m_unitName;
00025 double m_factor;
00026
00027 public:
00028 UnitsObject(std::string name, double factor) {
00029 m_unitName = name;
00030 m_factor = factor;
00031 }
00032
00033 ~UnitsObject() {
00034 }
00035
00036 void setName(std::string name) {
00037 m_unitName = name;
00038 }
00039
00040 std::string getName() {
00041 return m_unitName;
00042 }
00043
00044 void setFactor(double factor) {
00045 m_factor = factor;
00046 }
00047
00048 double getFactor() {
00049 return m_factor;
00050 }
00051 };
00052
00053
00054 class UnitsExtension {
00055 private:
00056 std::vector<UnitsObject> unitVector;
00057 bool addUnit(std::string name, double factor);
00058
00059 public:
00060 bool existsUnit(std::string name);
00061 double getFactor(std::string name);
00062 bool getUnits(std::string definitionFile);
00063 };
00064
00065
00066 #endif
00067