OnixS C++ CME MDP Conflated UDP Handler 1.1.2
API documentation
Loading...
Searching...
No Matches
Composites.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
26
28ONIXS_CONFLATEDUDP_DATA_PACKING_BEGIN(1)
29
30
31typedef
32FixedPointDecimal
33<
34 Int64,
35 IntegralConstant<Int8, -9>
36>
38
39
42{
45 typedef Decimal9 Value;
46
48 typedef
51
53 bool
54 operator ==(
55 const Value& other) const
56 {
57 return (
58 NullMantissa() ==
59 other.mantissa()
60 );
61 }
62
64 bool
65 operator !=(
66 const Value& other) const
67 {
68 return !(*this == other);
69 }
70};
71
75typedef
76FixedPointDecimal
77<
78 Int32,
79 IntegralConstant<Int8, -4>
80>
82
83
86{
90
92 typedef
95
97 bool
98 operator ==(
99 const Value& other) const
100 {
101 return (
102 NullMantissa() ==
103 other.mantissa()
104 );
105 }
106
108 bool
109 operator !=(
110 const Value& other) const
111 {
112 return !(*this == other);
113 }
114};
115
120{
121public:
123 enum { Size = 5 };
124
126 typedef UInt16 Year;
127
129 typedef
132
134 typedef UInt8 Month;
135
137 typedef
140
142 typedef UInt8 Day;
143
145 typedef
148
150 typedef UInt8 Week;
151
153 typedef
156
161 : year_(NullYear::value()),
162 month_(NullMonth::value()),
163 day_(NullDay::value()),
164 week_(NullWeek::value())
165 {
166 }
167
169 Year year() const
170 {
171 return year_;
172 }
173
175 bool
177 Month& value) const
178 {
179 if (NullMonth() == month_) return false;
180 value = month_;
181 return true;
182 }
183
185 bool
187 Day& value) const
188 {
189 if (NullDay() == day_) return false;
190 value = day_;
191 return true;
192 }
193
195 bool
197 Week& value) const
198 {
199 if (NullWeek() == week_) return false;
200 value = week_;
201 return true;
202 }
203
204private:
205 Year year_;
206 Month month_;
207 Day day_;
208 Week week_;
209};
210
211
214{
218
220 bool
221 operator ==(
222 const Value& other) const
223 {
224 return (
226 other.year()
227 );
228 }
229
231 bool
232 operator !=(
233 const Value& other) const
234 {
235 return !(*this == other);
236 }
237};
238
240typedef
241FixedPointDecimal
242<
243 Int64,
244 IntegralConstant<Int8, -9>
245>
247
248
251{
254 typedef PRICE9 Value;
255
257 typedef
260
262 bool
263 operator ==(
264 const Value& other) const
265 {
266 return (
267 NullMantissa() ==
268 other.mantissa()
269 );
270 }
271
273 bool
274 operator !=(
275 const Value& other) const
276 {
277 return !(*this == other);
278 }
279};
280
285{
286public:
288 enum { Size = 3 };
289
292
295
300 : blockLength_(0),
301 numInGroup_(0)
302 {
303 }
304
307 {
308 return blockLength_;
309 }
310
313 {
314 return numInGroup_;
315 }
316
317private:
318 BlockLength blockLength_;
319 NumInGroup numInGroup_;
320};
321
322
327{
328public:
330 enum { Size = 8 };
331
334
337
342 : blockLength_(0),
343 numInGroup_(0)
344 {
345 }
346
349 {
350 return blockLength_;
351 }
352
355 {
356 return numInGroup_;
357 }
358
359protected:
360 // Alignment tricks.
361 typedef Byte Padding1[5];
362
363 // Alignment tricks.
364 const void* padding1() const
365 {
366 return padding1_;
367 }
368
369private:
370 BlockLength blockLength_;
371 Padding1 padding1_;
372 NumInGroup numInGroup_;
373};
374
375
378{
379public:
381 enum { Size = 4 };
382
387
392
397 : blockLength_(0),
398 numInGroup_(0)
399 {
400 }
401
406 {
407 return blockLength_;
408 }
409
414 {
415 return numInGroup_;
416 }
417
418private:
419 BlockLength blockLength_;
420 NumInGroup numInGroup_;
421};
422
423
426{
427public:
429 enum { Size = 8 };
430
433
436
439
442
447 : blockLength_(0),
448 templateId_(0),
449 schemaId_(0),
450 version_(0)
451 {
452 }
453
456 {
457 return blockLength_;
458 }
459
462 {
463 return templateId_;
464 }
465
468 {
469 return schemaId_;
470 }
471
474 {
475 return version_;
476 }
477
478private:
479 BlockLength blockLength_;
480 TemplateId templateId_;
481 SchemaId schemaId_;
482 Version version_;
483};
484
485
486ONIXS_CONFLATEDUDP_DATA_PACKING_END
#define ONIXS_CONFLATEDUDP_LTWT_STRUCT
Definition Bootstrap.h:99
#define ONIXS_CONFLATEDUDP_LTWT_CLASS
Definition Bootstrap.h:95
#define ONIXS_CONFLATEDUDP_NAMESPACE_END
Definition Bootstrap.h:157
#define ONIXS_CONFLATEDUDP_NAMESPACE_BEGIN
Definition Bootstrap.h:153
Mantissa mantissa() const
Returns mantissa of given decimal.
Definition Decimal.h:80
NumInGroup numInGroup() const
NumInGroup.
Definition Composites.h:354
BlockLength blockLength() const
Length.
Definition Composites.h:348
NumInGroup numInGroup() const
numInGroup field.
Definition Composites.h:312
BlockLength blockLength() const
blockLength field.
Definition Composites.h:306
UInt8 NumInGroup
numInGroup type.
Definition Composites.h:294
UInt16 BlockLength
blockLength type.
Definition Composites.h:291
IntegralConstant< UInt8, 255 > NullDay
Null value for optional Day field.
Definition Composites.h:147
IntegralConstant< UInt16, 65535 > NullYear
Null value for optional Year field.
Definition Composites.h:131
bool month(Month &value) const
MM.
Definition Composites.h:176
IntegralConstant< UInt8, 255 > NullWeek
Null value for optional Week field.
Definition Composites.h:155
IntegralConstant< UInt8, 255 > NullMonth
Null value for optional Month field.
Definition Composites.h:139
BlockLength blockLength() const
blockLength field.
Definition Composites.h:455
SchemaId schemaId() const
schemaId field.
Definition Composites.h:467
UInt16 BlockLength
blockLength type.
Definition Composites.h:432
TemplateId templateId() const
templateId field.
Definition Composites.h:461
Version version() const
version field.
Definition Composites.h:473
FixedPointDecimal< Int32, IntegralConstant< Int8, -4 > > DecimalQty
Definition Composites.h:81
FixedPointDecimal< Int64, IntegralConstant< Int8, -9 > > Decimal9
Decimal with constant exponent -9.
Definition Composites.h:37
FixedPointDecimal< Int64, IntegralConstant< Int8, -9 > > PRICE9
Price with constant exponent -9.
Definition Composites.h:246
UInt16 UInt16
uInt16.
Definition Fields.h:257
UInt8 Byte
Alias for Byte.
Definition Memory.h:30
Identifies months in year.
Definition Time.h:447
Null values definition for optional Decimal9 field.
Definition Composites.h:42
IntegralConstant< Int64, 9223372036854775807LL > NullMantissa
Null value for optional Mantissa field.
Definition Composites.h:50
Null values definition for optional DecimalQty field.
Definition Composites.h:86
IntegralConstant< Int32, 2147483647 > NullMantissa
Null value for optional Mantissa field.
Definition Composites.h:94
Null values definition for optional MaturityMonthYear field.
Definition Composites.h:214
Null values definition for optional PRICE9 field.
Definition Composites.h:251
IntegralConstant< Int64, 9223372036854775807LL > NullMantissa
Null value for optional Mantissa field.
Definition Composites.h:259