OnixS C++ CME MDP Conflated UDP Handler 1.1.2
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 Value value()
107 {
108 return Constant;
109 }
110};
111
113ONIXS_CONFLATEDUDP_EXPORTED
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
133ONIXS_CONFLATEDUDP_EXPORTED
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
153ONIXS_CONFLATEDUDP_EXPORTED
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
173ONIXS_CONFLATEDUDP_EXPORTED
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
193ONIXS_CONFLATEDUDP_EXPORTED
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
213ONIXS_CONFLATEDUDP_EXPORTED
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
233ONIXS_CONFLATEDUDP_EXPORTED
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
253ONIXS_CONFLATEDUDP_EXPORTED
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 <Type, Constant> constant)
298{
299 std::string str;
300
301 toStr(str, constant);
302
303 return str;
304}
305
306//
307
314ONIXS_CONFLATEDUDP_EXPORTED
315bool
317 Int8&,
318 const Char*,
319 size_t);
320
327ONIXS_CONFLATEDUDP_EXPORTED
328bool
330 UInt8&,
331 const Char*,
332 size_t);
333
340ONIXS_CONFLATEDUDP_EXPORTED
341bool
343 Int16&,
344 const Char*,
345 size_t);
346
353ONIXS_CONFLATEDUDP_EXPORTED
354bool
356 UInt16&,
357 const Char*,
358 size_t);
359
366ONIXS_CONFLATEDUDP_EXPORTED
367bool
369 Int32&,
370 const Char*,
371 size_t);
372
379ONIXS_CONFLATEDUDP_EXPORTED
380bool
382 UInt32&,
383 const Char*,
384 size_t);
385
392ONIXS_CONFLATEDUDP_EXPORTED
393bool
395 Int64&,
396 const Char*,
397 size_t);
398
405ONIXS_CONFLATEDUDP_EXPORTED
406bool
408 UInt64&,
409 const Char*,
410 size_t);
411
#define ONIXS_CONFLATEDUDP_NAMESPACE_END
Definition Bootstrap.h:157
#define ONIXS_CONFLATEDUDP_NAMESPACE_BEGIN
Definition Bootstrap.h:153
ONIXS_CONFLATEDUDP_EXPORTED bool fromStr(Decimal &, const Char *, size_t)
UInt64 UInt64
uInt64.
Definition Fields.h:265
ONIXS_CONFLATEDUDP_EXPORTED void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.
Int32 Int32
int32.
Definition Fields.h:69
char Char
Character type alias.
Definition String.h:36
UInt32 UInt32
uInt32.
Definition Fields.h:261
Int16 Int16
int16.
Definition Fields.h:65
UInt16 UInt16
uInt16.
Definition Fields.h:257
static Value value()
Returns value of the constant.
Definition Integral.h:106
Value operator()() const
Returns value of the constant.
Definition Integral.h:100