OnixS C++ CME MDP Streamlined Market Data Handler 1.2.0
API Documentation
Loading...
Searching...
No Matches
Integral.h
Go to the documentation of this file.
1// Copyright Onix Solutions Limited [OnixS]. All rights reserved.
2//
3// This software owned by Onix Solutions Limited [OnixS] and is
4// protected by copyright law and international copyright treaties.
5//
6// Access to and use of the software is governed by the terms of the applicable
7// OnixS Software Services Agreement (the Agreement) and Customer end user license
8// agreements granting a non-assignable, non-transferable and non-exclusive license
9// to use the software for it's own data processing purposes under the terms defined
10// in the Agreement.
11//
12// Except as otherwise granted within the terms of the Agreement, copying or
13// reproduction of any part of this source code or associated reference material
14// to any other location for further reproduction or redistribution, and any
15// amendments to this copyright notice, are expressly prohibited.
16//
17// Any reproduction or redistribution for sale or hiring of the Software not in
18// accordance with the terms of the Agreement is a violation of copyright law.
19//
20
21#pragma once
22
23#include <string>
24
26
28
29#if defined (_MSC_VER)
30
31typedef signed char Int8;
32typedef unsigned char UInt8;
33
34typedef signed short Int16;
35typedef unsigned short UInt16;
36
37typedef signed int Int32;
38typedef unsigned int UInt32;
39
40typedef signed long long Int64;
41typedef unsigned long long UInt64;
42
43#elif defined (__GNUC__)
44
45typedef signed char Int8;
46typedef unsigned char UInt8;
47
48typedef signed short Int16;
49typedef unsigned short UInt16;
50
51#if defined (__LP64__)
52
53typedef signed int Int32;
54typedef unsigned int UInt32;
55
56typedef signed long Int64;
57typedef unsigned long UInt64;
58
59#else
60
61typedef signed int Int32;
62typedef unsigned int UInt32;
63
64typedef signed long long Int64;
65typedef unsigned long long UInt64;
66
67#endif
68
69#else
70
71// Compiler is not (yet) supported.
72// Integral types must be defined explicitly.
73
74#error \
75 Cannot identify compiler toolset to define integral types. \
76 Please contact support@onixs.biz on further assistance.
77
78#endif
79
80//
81
83template
84<
85 typename Type,
86 Type Constant
87>
89{
91 typedef Type Value;
92
94 operator Value() const
95 {
96 return Constant;
97 }
98
101 {
102 return Constant;
103 }
104
106 static const Value value()
107 {
108 return Constant;
109 }
110};
111
114void
116 std::string&,
117 Int8);
118
120inline
121std::string
123 Int8 number)
124{
125 std::string str;
126
127 toStr(str, number);
128
129 return str;
130}
131
134void
136 std::string&,
137 UInt8);
138
140inline
141std::string
143 UInt8 number)
144{
145 std::string str;
146
147 toStr(str, number);
148
149 return str;
150}
151
154void
156 std::string&,
157 Int16);
158
160inline
161std::string
163 Int16 number)
164{
165 std::string str;
166
167 toStr(str, number);
168
169 return str;
170}
171
174void
176 std::string&,
177 UInt16);
178
180inline
181std::string
183 UInt16 number)
184{
185 std::string str;
186
187 toStr(str, number);
188
189 return str;
190}
191
194void
196 std::string&,
197 Int32);
198
200inline
201std::string
203 Int32 number)
204{
205 std::string str;
206
207 toStr(str, number);
208
209 return str;
210}
211
214void
216 std::string&,
217 UInt32);
218
220inline
221std::string
223 UInt32 number)
224{
225 std::string str;
226
227 toStr(str, number);
228
229 return str;
230}
231
234void
236 std::string&,
237 Int64);
238
240inline
241std::string
243 Int64 number)
244{
245 std::string str;
246
247 toStr(str, number);
248
249 return str;
250}
251
254void
256 std::string&,
257 UInt64);
258
260inline
261std::string
263 UInt64 number)
264{
265 std::string str;
266
267 toStr(str, number);
268
269 return str;
270}
271
273template
274<
275 typename Type,
276 Type Constant
277>
278inline
279void
281 std::string& str,
283{
284 toStr(str, constant());
285}
286
288template
289<
290 typename Type,
291 Type Constant
292>
293inline
294std::string
297{
298 std::string str;
299
300 toStr(str, constant);
301
302 return str;
303}
304
#define ONIXS_CMESTREAMLINEDMDH_NAMESPACE_BEGIN
Definition Bootstrap.h:169
#define ONIXS_CMESTREAMLINEDMDH_NAMESPACE_END
Definition Bootstrap.h:173
#define ONIXS_CMESTREAMLINEDMDH_EXPORTED
Definition Compiler.h:160
void toStr(std::string &str, const Decimal &number)
Definition Decimal.h:502
static const Value value()
Returns value of the constant.
Definition Integral.h:106
Value operator()() const
Returns value of the constant.
Definition Integral.h:100