GTXclient C++ API GTXserver-16.0.2

- Main Page
- Related Pages
- Classes
- Files
- Examples

- File List

GTXVariableFormat.hpp
1 /*****************************************************************************
2
3 Copyright (c)2007 Geovariances, Avon, France.
4
5 In consideration of payment of the license fee, which is a part of
6 the price you paid for this product, Geovariances (GV) as licensor,
7 grants you, the licensee, a non-exclusive right to use this copy of a
8 GV software product.
9 GV reserves all rights not expressly granted to licensee. GV retains
10 titleship and ownership of software. This license is not a sale of
11 the original software or any copy. GV also retains titleship and
12 ownership of any modifications or derivations of this software. Any
13 modifications of this software must be clearly marked as such. This
14 copyright message must appear in its entirety in this software, or
15 any modifications or derivations thereof.
16
17 Geovariances welcomes any comments, suggestions, bug reports, etc. At
18 the discretion of Geovariances, any customer supplied bug fixes,
19 enhancements, or utility codes will be distributed in future software
20 releases (the contributor will of course be credited).
21
22 Geovariances
23 49bis, Avenue Franklin Roosevelt
24 77210 Avon, FRANCE
25
26 Phone: +33-(0)-160.749.100
27 Fax: +33-(0)-164.228.728
28 e-mail: support@geovariances.fr
29
30 All Rights Reserved
31
32 *****************************************************************************/
33
34 #ifndef __GTXVariableFormat_hpp__
35 #define __GTXVariableFormat_hpp__
36
37 #define __USING_GTXSERVER_CPP_API__
38
39 #ifdef DOXYGEN
40 #define SWIG_OR_DOXYGEN
41 #endif //DOXYGEN
42
43 #ifdef SWIG
44 #define GLOBAL_CLASS
45 #define SWIG_OR_DOXYGEN
46 #else //SWIG
47 #include <GTXClient.h>
48 #endif //SWIG
49
53 class GLOBAL_CLASS GTXVariableFormat
54 {
55 public:
57 enum FormatType
58 {
59 FORMAT_TYPE_DECIMAL,
60 FORMAT_TYPE_INTEGER,
61 FORMAT_TYPE_EXPONENT,
62 FORMAT_TYPE_FREE,
63 FORMAT_TYPE_SHIFTED,
64 FORMAT_TYPE_INVALID
65 };
66
68 GTXVariableFormat();
69
71 void SetType(FormatType format);
73 FormatType GetFormatType();
74
76 void SetLength(int length);
78 int GetLength();
79
81 void SetDigits(int digits);
83 int GetDigits();
84
86 void SetUnit(const char *unit);
88 char *GetUnit();
89
90 private:
91 FormatType _type;
92 int _length;
93 int _digits;
94 char _unit[11];
95 friend class GTXClient;
96 };
97
98 inline GTXVariableFormat::FormatType GTXVariableFormat::GetFormatType()
99 {
100 return _type;
101 }
102
103 inline void GTXVariableFormat::SetType(GTXVariableFormat::FormatType type)
104 {
105 _type = type;
106 }
107
108 inline int GTXVariableFormat::GetLength()
109 {
110 return _length;
111 }
112
113 inline void GTXVariableFormat::SetLength(int length)
114 {
115 _length = length;
116 }
117
118 inline int GTXVariableFormat::GetDigits()
119 {
120 return _digits;
121 }
122
123 inline void GTXVariableFormat::SetDigits(int digits)
124 {
125 _digits = digits;
126 }
127
128 inline char *GTXVariableFormat::GetUnit()
129 {
130 return _unit;
131 }
132
133 inline void GTXVariableFormat::SetUnit(const char *unit)
134 {
135 int i;
136 for (i = 0; i < 10; i++)
137 {
138 if (unit[i] == '\0')
139 break;
140 _unit[i] = unit[i];
141 }
142 _unit[i] = '\0';
143 }
144
145 #endif // __GTXVariableFormat_hpp__