VAPOR3 3.9.4
UDUnitsClass.h
Go to the documentation of this file.
1//
2// $Id$
3//
4
5#ifndef _UDUnitsClass_h_
6#define _UDUnitsClass_h_
7
8#include <string>
9#include <vector>
10#include <map>
11#include <algorithm>
12#include <vapor/common.h>
13
14union ut_unit;
15struct ut_system;
16
17namespace VAPoR {
18
29public:
32
33 static std::string GetDatabasePath();
34
41
45 bool IsPressureUnit(std::string unitstr) const;
46
50 bool IsTimeUnit(std::string unitstr) const;
51
55 bool IsLatUnit(std::string unitstr) const;
56
60 bool IsLonUnit(std::string unitstr) const;
61
65 bool IsLatOrLonUnit(std::string unitstr) const;
66
70 bool IsLengthUnit(std::string unitstr) const;
71
76 bool AreUnitsConvertible(const ut_unit *unit, std::string unitstr) const;
77
81 bool ValidUnit(std::string unitstr) const;
82
103 bool Convert(const std::string from, const std::string to, const float *src, float *dst, size_t n) const;
104
105 bool Convert(const std::string from, const std::string to, const double *src, double *dst, size_t n) const;
106
113 void DecodeTime(double seconds, int *year, int *month, int *day, int *hour, int *minute, int *second) const;
114
121 double EncodeTime(int year, int month, int day, int hour, int minute, int second) const;
122
128 std::string GetErrMsg() const;
129
130private:
131 std::map<int, std::string> _statmsg;
132 int _status;
133 ut_unit * _pressureUnit;
134 ut_unit * _timeUnit;
135 ut_unit * _latUnit;
136 ut_unit * _lonUnit;
137 ut_unit * _lengthUnit;
138 ut_system * _unitSystem;
139};
140}; // namespace VAPoR
141#endif
bool IsLengthUnit(std::string unitstr) const
bool AreUnitsConvertible(const ut_unit *unit, std::string unitstr) const
bool IsPressureUnit(std::string unitstr) const
void DecodeTime(double seconds, int *year, int *month, int *day, int *hour, int *minute, int *second) const
double EncodeTime(int year, int month, int day, int hour, int minute, int second) const
std::string GetErrMsg() const
bool IsLonUnit(std::string unitstr) const
bool ValidUnit(std::string unitstr) const
bool Convert(const std::string from, const std::string to, const double *src, double *dst, size_t n) const
bool IsLatUnit(std::string unitstr) const
bool Convert(const std::string from, const std::string to, const float *src, float *dst, size_t n) const
bool IsLatOrLonUnit(std::string unitstr) const
static std::string GetDatabasePath()
bool IsTimeUnit(std::string unitstr) const
#define VDF_API
Definition: common.h:73
union ut_unit ut_unit
Definition: udunits2.h:17
struct ut_system ut_system
Definition: udunits2.h:16