OnixS C++ CME iLink 3 Binary Order Entry Handler 1.18.9
API Documentation
Loading...
Searching...
No Matches
ValueConverters.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
25
30
33
35
41{
44 virtual const Char* typeName() const ONIXS_ILINK3_NOTHROW = 0;
45
48 virtual void toStr(std::string&, const ValueContainer&) const
49 {
50 }
51
53 virtual StrRef toStr(Char*, size_t, const ValueContainer&) const
54 {
55 throwBadConversion(typeName());
56 }
57
62 {
63 return false;
64 }
65
69 virtual bool convert(Char&, const ValueContainer&) const ONIXS_ILINK3_NOTHROW
70 {
71 return false;
72 }
73
77 virtual bool convert(Int8&, const ValueContainer&) const ONIXS_ILINK3_NOTHROW
78 {
79 return false;
80 }
81
85 virtual bool convert(UInt8&, const ValueContainer&) const ONIXS_ILINK3_NOTHROW
86 {
87 return false;
88 }
89
93 virtual bool convert(Int16&, const ValueContainer&) const ONIXS_ILINK3_NOTHROW
94 {
95 return false;
96 }
97
102 {
103 return false;
104 }
105
110 {
111 return false;
112 }
113
118 {
119 return false;
120 }
121
125 virtual bool convert(Int64&, const ValueContainer&) const ONIXS_ILINK3_NOTHROW
126 {
127 return false;
128 }
129
134 {
135 return false;
136 }
137
142 {
143 return false;
144 }
145
149 virtual bool convert(Timestamp&, const ValueContainer&) const
150 {
151 return false;
152 }
153
158 {
159 return false;
160 }
161
162protected:
164};
165
179
183{
185
187 {
188 return "String";
189 }
190
191 void
193 std::string& str,
194 const ValueContainer& container) const ONIXS_ILINK3_OVERRIDE
195 {
196 const
197 StrRef&
198 ref =
199 container.get<StrRef>();
200
201 str.
202 assign(
203 ref.data(),
204 ref.size());
205 }
206
207 StrRef
209 Char*, size_t, const ValueContainer& container) const ONIXS_ILINK3_NOTHROW ONIXS_ILINK3_OVERRIDE
210 {
211 return container.get<StrRef>();
212 }
213
214 bool
216 StrRef& ref,
218 {
219 ref = container.get<StrRef>();
220
221 return true;
222 }
223
224 bool
226 Char& value,
228 {
229 const
230 StrRef&
231 str =
232 container.get<StrRef>();
233
234 if (1 == str.size())
235 {
236 value = str[0];
237
238 return true;
239 }
240 else if (str.empty())
241 {
242 value = 0;
243
244 return true;
245 }
246
247 return false;
248 }
249
250 bool
252 Int8& value,
254 {
255 const
256 StrRef&
257 str =
258 container.get<StrRef>();
259
260 return
261 fromStr(
262 value,
263 str.data(),
264 str.size());
265 }
266
267 bool
269 UInt8& value,
271 {
272 const
273 StrRef&
274 str =
275 container.get<StrRef>();
276
277 return
278 fromStr(
279 value,
280 str.data(),
281 str.size());
282 }
283
284 bool
286 Int16& value,
288 {
289 const
290 StrRef&
291 str =
292 container.get<StrRef>();
293
294 return
295 fromStr(
296 value,
297 str.data(),
298 str.size());
299 }
300
301 bool
303 UInt16& value,
305 {
306 const
307 StrRef&
308 str =
309 container.get<StrRef>();
310
311 return
312 fromStr(
313 value,
314 str.data(),
315 str.size());
316 }
317
318 bool
320 Int32& value,
322 {
323 const
324 StrRef&
325 str =
326 container.get<StrRef>();
327
328 return
329 fromStr(
330 value,
331 str.data(),
332 str.size());
333 }
334
335 bool
337 UInt32& value,
339 {
340 const
341 StrRef&
342 str =
343 container.get<StrRef>();
344
345 return
346 fromStr(
347 value,
348 str.data(),
349 str.size());
350 }
351
352 bool
354 Int64& value,
356 {
357 const
358 StrRef&
359 str =
360 container.get<StrRef>();
361
362 return
363 fromStr(
364 value,
365 str.data(),
366 str.size());
367 }
368
369 bool
371 UInt64& value,
373 {
374 const
375 StrRef&
376 str =
377 container.get<StrRef>();
378
379 return
380 fromStr(
381 value,
382 str.data(),
383 str.size());
384 }
385
386 bool
388 Decimal& value,
390 {
391 const
392 StrRef&
393 str =
394 container.get<StrRef>();
395
396 return
397 fromStr(
398 value,
399 str.data(),
400 str.size());
401 }
402
403 bool
405 Timestamp& value,
406 const ValueContainer& container) const ONIXS_ILINK3_OVERRIDE
407 {
408 const
409 StrRef&
410 str =
411 container.get<StrRef>();
412
413 return
414 fromStr(
415 value,
416 str.data(),
417 str.size());
418 }
419
421
422protected:
424};
425
426//
427
432{
434
439
440 void
442 std::string& str,
443 const ValueContainer& container) const ONIXS_ILINK3_OVERRIDE
444 {
445 str.append(
446 1,
447 container.get<Char>());
448 }
449
450 StrRef
452 Char*, size_t, const ValueContainer& container) const ONIXS_ILINK3_NOTHROW ONIXS_ILINK3_OVERRIDE
453 {
454 return
455 StrRef(
456 &container.get<Char>(),
457 1);
458 }
459
460 bool
462 StrRef& ref,
464 {
465 ref =
466 StrRef(
467 &container.get<Char>(),
468 1);
469
470 return true;
471 }
472
473 bool
475 Char& value,
477 {
478 value = container.get<Char>();
479
480 return true;
481 }
482
483 bool
485 Int8& value,
487 {
488 return
489 charToDigit(
490 value,
491 container.get<Char>());
492 }
493
494 bool
496 UInt8& value,
498 {
499 return
500 charToDigit(
501 value,
502 container.get<Char>());
503 }
504
505 bool
507 Int16& value,
509 {
510 return
511 charToDigit(
512 value,
513 container.get<Char>());
514 }
515
516 bool
518 UInt16& value,
520 {
521 return
522 charToDigit(
523 value,
524 container.get<Char>());
525 }
526
527 bool
529 Int32& value,
531 {
532 return
533 charToDigit(
534 value,
535 container.get<Char>());
536 }
537
538 bool
540 UInt32& value,
542 {
543 return
544 charToDigit(
545 value,
546 container.get<Char>());
547 }
548
549 bool
551 Int64& value,
553 {
554 return
555 charToDigit(
556 value,
557 container.get<Char>());
558 }
559
560 bool
562 UInt64& value,
564 {
565 return
566 charToDigit(
567 value,
568 container.get<Char>());
569 }
570
571 bool
573 Decimal& value,
575 {
576 Decimal::Mantissa mantissa;
577
578 if (charToDigit(
579 mantissa,
580 container.get<Char>()))
581 {
582 value = Decimal(mantissa, 0);
583
584 return true;
585 }
586
587 return false;
588 }
589
591
592protected:
594
595private:
596 template
597 <
598 class Integer
599 >
600 static
601 bool
602 charToDigit(
603 Integer& converted,
604 Char original) ONIXS_ILINK3_NOTHROW
605 {
606 if ('0' <= original &&
607 '9' >= original)
608 {
609 converted =
610 static_cast
611 <Integer>
612 (original - '0');
613
614 return true;
615 }
616
617 return false;
618 }
619};
620
622template
623<
624 class Integer
625>
626class
628: public ValueConverter
629{
630 template
631 <
632 class Integral,
633 bool IsSigned
634 >
635 struct
636 FitsToChar
637 {
638 bool
639 operator ()(
640 Integral value) const ONIXS_ILINK3_NOTHROW
641 {
642 return (
643 0 <= value &&
644 value < 10
645 );
646 }
647 };
648
649 template
650 <
651 class Integral
652 >
653 struct
654 FitsToChar
655 <
656 Integral,
657 false
658 >
659 {
660 bool
661 operator ()(
662 Integral value) const ONIXS_ILINK3_NOTHROW
663 {
664 return (value < 10);
665 }
666 };
667
668 typedef
669 FitsToChar
670 <
671 Integer,
672 !(
673 static_cast<Integer>(-1) >
674 static_cast<Integer>(0)
675 )
676 >
677 CanFitToChar;
678
679public:
681
682 void
684 std::string& str,
685 const ValueContainer& container) const ONIXS_ILINK3_OVERRIDE
686 {
688 str,
689 container.get<Integer>());
690 }
691
692 StrRef
694 Char* buf, size_t size, const ValueContainer& container) const ONIXS_ILINK3_OVERRIDE
695 {
696 assert(buf);
697
698 const size_t converted =
700 container.get<Integer>(),
701 buf,
702 size);
703
704 assert(converted < size);
705 assert(converted != 0);
706
707 return
708 StrRef(buf, converted);
709 }
710
711 bool
713 Char& value,
715 {
716 const
717 Integer
718 actual =
719 container.get<Integer>();
720
721 if (CanFitToChar()(actual))
722 {
723 value =
724 static_cast
725 <Char>
726 ('0' + actual);
727
728 return true;
729 }
730
731 return false;
732 }
733
734 bool
736 Int8& value,
738 {
739 value =
740 numericCast<Int8>(
741 container.get<Integer>());
742
743 return true;
744 }
745
746 bool
748 UInt8& value,
750 {
751 value =
752 numericCast<UInt8>(
753 container.get<Integer>());
754
755 return true;
756 }
757
758 bool
760 Int16& value,
762 {
763 value =
764 numericCast<Int16>(
765 container.get<Integer>());
766
767 return true;
768 }
769
770 bool
772 UInt16& value,
774 {
775 value =
776 numericCast<UInt16>(
777 container.get<Integer>());
778
779 return true;
780 }
781
782 bool
784 Int32& value,
786 {
787 value =
788 numericCast<Int32>(
789 container.get<Integer>());
790
791 return true;
792 }
793
794 bool
796 UInt32& value,
798 {
799 value =
800 numericCast<UInt32>(
801 container.get<Integer>());
802
803 return true;
804 }
805
806 bool
808 Int64& value,
810 {
811 value =
812 numericCast<Int64>(
813 container.get<Integer>());
814
815 return true;
816 }
817
818 bool
820 UInt64& value,
822 {
823 value =
824 numericCast<UInt64>(
825 container.get<Integer>());
826
827 return true;
828 }
829
830 bool
832 Decimal& value,
834 {
835 value =
836 Decimal
837 (
838 numericCast<Decimal::Mantissa>(
839 container.get<Integer>()),
840 0
841 );
842
843 return true;
844 }
845
846 bool
848 Timestamp& value,
850 {
851 value =
853 numericCast<UInt64>(
854 container.get<Integer>()));
855
856 return true;
857 }
858
859protected:
861};
862
881
900
919
938
957
976
995
1014
1018{
1020
1022 {
1023 return "Decimal";
1024 }
1025
1026 void
1028 std::string& str,
1029 const ValueContainer& container) const ONIXS_ILINK3_OVERRIDE
1030 {
1032 str,
1033 container.get<Decimal>());
1034 }
1035
1036 StrRef
1038 Char* buf, size_t size, const ValueContainer& container) const ONIXS_ILINK3_OVERRIDE
1039 {
1040 assert(buf);
1041
1042 const size_t converted =
1044 container.get<Decimal>(),
1045 buf,
1046 size);
1047
1048 assert(converted != 0);
1049 assert(converted < size);
1050
1051 return
1052 StrRef(buf, converted);
1053 }
1054
1055 bool
1057 Decimal& value,
1059 {
1060 value = container.get<Decimal>();
1061
1062 return true;
1063 }
1064
1066
1067protected:
1069};
1070
1071//
1072
1076{
1078
1080 {
1081 return "Timestamp";
1082 }
1083
1084 void
1086 std::string& str,
1087 const ValueContainer& container) const ONIXS_ILINK3_OVERRIDE
1088 {
1090 str,
1091 container.get<Timestamp>());
1092 }
1093
1094 StrRef
1096 Char* buf, size_t size, const ValueContainer& container) const ONIXS_ILINK3_OVERRIDE
1097 {
1098 assert(buf);
1099
1100 const size_t converted =
1102 container.get<Timestamp>(),
1103 buf,
1104 size);
1105
1106 assert(converted < size);
1107 assert(converted != 0);
1108
1109 return
1110 StrRef(buf, converted);
1111 }
1112
1113 bool
1115 Int64& value,
1117 {
1118 value =
1119 numericCast<Int64>
1120 (
1121 container.
1122 get<Timestamp>().
1123 sinceEpoch()
1124 );
1125
1126 return true;
1127 }
1128
1129 bool
1131 UInt64& value,
1133 {
1134 value =
1135 container.
1136 get<Timestamp>().
1137 sinceEpoch();
1138
1139 return true;
1140 }
1141
1142 bool
1144 Timestamp& value,
1146 {
1147 value = container.get<Timestamp>();
1148
1149 return true;
1150 }
1151
1153
1154protected:
1156};
1157
1162{
1165
1167 {
1168 return "MaturityMonthYear";
1169 }
1170
1171 void
1173 std::string& str,
1174 const ValueContainer& container) const ONIXS_ILINK3_OVERRIDE
1175 {
1177 str,
1178 container.get<MaturityMonthYear>());
1179 }
1180
1181 bool
1183 MaturityMonthYear& value,
1185 {
1186 value =
1187 container.
1188 get
1190 ();
1191
1192 return true;
1193 }
1194
1196
1197protected:
1199};
1200
1203{
1210};
1211
1213template
1214<
1215 class Value
1216>
1218{
1219 typedef
1220 char
1221 Ordinary[1];
1222
1223 typedef
1224 char
1225 Enumeration[2];
1226
1227 typedef
1228 char
1229 Bits[3];
1230
1231 template
1232 <
1233 class Other
1234 >
1235 static
1236 Bits&
1237 kind(
1238 typename
1239 Other::Bits*);
1240
1241 template
1242 <
1243 class Other
1244 >
1245 static
1246 Enumeration&
1247 kind(
1248 typename
1249 Other::Enum*);
1250
1251 template
1252 <
1253 class Other
1254 >
1255 static
1256 Ordinary&
1257 kind(
1258 ...);
1259
1260public:
1261 enum
1262 {
1265 (
1266 sizeof(Bits) ==
1267 sizeof(kind<Value>(ONIXS_ILINK3_NULLPTR))
1269 : (
1270 sizeof(Enumeration) ==
1271 sizeof(kind<Value>(ONIXS_ILINK3_NULLPTR))
1274 )
1275 )
1276 };
1277};
1278
1280template
1281<
1282 class Value,
1283 int
1284>
1285struct
1287{
1289 typedef Value Result;
1290
1297 static Result convert(const ValueConverter& converter, const ValueContainer& container)
1298 {
1299 Result result;
1300
1301 if (!converter.
1302 convert(
1303 result,
1304 container))
1305 {
1306 throwBadConversion(
1307 converter.typeName());
1308 }
1309
1310 return result;
1311 }
1312
1319 static bool convert(Result& result, const ValueConverter& converter, const ValueContainer& container)
1320 {
1321 return
1322 converter.
1323 convert(
1324 result,
1325 container);
1326 }
1327};
1328
1332template
1333<
1334 class Enumeration
1335>
1336struct
1338<
1339 Enumeration,
1341>
1342{
1344 typedef
1345 typename
1346 Enumeration::Enum
1348
1353 static
1354 Result
1356 const
1358 converter,
1359 const
1361 container)
1362 {
1363 typename
1364 Enumeration::Base
1365 result;
1366
1367 if (!converter.
1368 convert(
1369 result,
1370 container))
1371 {
1372 throwBadConversion(
1373 converter.typeName());
1374 }
1375
1376 return
1377 static_cast
1378 <Result>
1379 (result);
1380 }
1381
1386 static
1387 bool
1389 Result& result,
1390 const
1392 converter,
1393 const
1395 container)
1396 {
1397 typename
1398 Enumeration::Base
1399 base;
1400
1401 if (converter.
1402 convert(
1403 base,
1404 container))
1405 {
1406 result =
1407 static_cast
1408 <Result>
1409 (base);
1410
1411 return true;
1412 }
1413
1414 return false;
1415 }
1416};
1417
1422template
1423<
1424 class BitSet
1425>
1426struct
1428<
1429 BitSet,
1431>
1432{
1434 typedef BitSet Result;
1435
1440 static
1441 BitSet
1443 const
1445 converter,
1446 const
1448 container)
1449 {
1450 typename
1451 BitSet::Bits
1452 bits;
1453
1454 if (!converter.
1455 convert(
1456 bits,
1457 container))
1458 {
1459 throwBadConversion(
1460 converter.typeName());
1461 }
1462
1463 return BitSet(bits);
1464 }
1465
1470 static
1471 bool
1473 BitSet& result,
1474 const
1476 converter,
1477 const
1479 container)
1480 {
1481 typename
1482 BitSet::Bits
1483 bits;
1484
1485 if (converter.
1486 convert(
1487 bits,
1488 container))
1489 {
1490 result = BitSet(bits);
1491
1492 return true;
1493 }
1494
1495 return false;
1496 }
1497};
1498
1501template
1502<
1503 class Value
1504>
1505struct
1507{
1509 typedef
1511 <
1512 Value,
1514 >
1516
1518 typedef
1519 typename
1522
1525 typename
1527 operator ()(
1528 const ValueConverter& converter,
1529 const ValueContainer& container) const
1530 {
1531 return
1532 Traits::
1533 convert(
1534 converter,
1535 container);
1536 }
1537
1540 bool
1541 operator ()(
1542 typename
1543 Traits::Result& result,
1544 const ValueConverter& converter,
1545 const ValueContainer& container) const
1546 {
1547 return
1548 Traits::
1549 convert(
1550 result,
1551 converter,
1552 container);
1553 }
1554};
1555
#define ONIXS_ILINK3_MESSAGING_TAGBASED_NAMESPACE_END
Definition ABI.h:153
#define ONIXS_ILINK3_MESSAGING_TAGBASED_NAMESPACE_BEGIN
Definition ABI.h:149
#define ONIXS_ILINK3_EXPORTED_STRUCT
Definition ABI.h:48
#define ONIXS_ILINK3_NODISCARD
Definition Compiler.h:185
#define ONIXS_ILINK3_FINAL
Definition Compiler.h:181
#define ONIXS_ILINK3_NULLPTR
Definition Compiler.h:182
#define ONIXS_ILINK3_DEFAULT
Definition Compiler.h:202
#define ONIXS_ILINK3_NOTHROW
Definition Compiler.h:176
#define ONIXS_ILINK3_OVERRIDE
Definition Compiler.h:180
Implements the value conversion for integer fields.
bool convert(UInt64 &value, const ValueContainer &container) const noexcept override
Tries to convert the value into an integer.
bool convert(UInt16 &value, const ValueContainer &container) const noexcept override
Tries to convert the value into an integer.
void toStr(std::string &str, const ValueContainer &container) const override
Outputs the text presentation of the value stored in the given container into the given string.
StrRef toStr(Char *buf, size_t size, const ValueContainer &container) const override
bool convert(Int16 &value, const ValueContainer &container) const noexcept override
Tries to convert the value into an integer.
bool convert(Timestamp &value, const ValueContainer &container) const noexcept override
Tries to convert the value into a timestamp.
bool convert(Char &value, const ValueContainer &container) const noexcept override
Tries to convert the value into a character.
bool convert(UInt8 &value, const ValueContainer &container) const noexcept override
Tries to convert the value into an integer.
bool convert(Int32 &value, const ValueContainer &container) const noexcept override
Tries to convert the value into an integer.
bool convert(Int8 &value, const ValueContainer &container) const noexcept override
Tries to convert the value into an integer.
bool convert(Int64 &value, const ValueContainer &container) const noexcept override
Tries to convert the value into an integer.
bool convert(UInt32 &value, const ValueContainer &container) const noexcept override
Tries to convert the value into an integer.
bool convert(Decimal &value, const ValueContainer &container) const noexcept override
Tries to convert the value into a Decimal.
Traits class used to identify a field value.
@ Kind
The kind of the given field value by its type.
The time point without the time-zone information.
Definition Time.h:468
Timestamp makeTimestamp(Timestamp::Ticks ticks) noexcept
Make Timestamp helper.
Definition Time.h:660
FloatingPointDecimal< Int64, Int32 > Decimal
Universal decimal type.
char Char
Character type alias.
Definition String.h:30
std::string toStr(const FixedPointDecimal< Mantissa, Exponent > &)
Serializes a fixed-point decimal into a string.
std::basic_string_view< Char > StrRef
Definition StrRef.h:46
bool fromStr(Decimal &, const Char *, size_t) noexcept
Deserializes a decimal number from the given text presentation.
Implements the value conversion for fields whose values represent a single character.
bool convert(UInt64 &value, const ValueContainer &container) const noexcept override
Tries to convert the value into an integer.
bool convert(StrRef &ref, const ValueContainer &container) const noexcept override
Tries to convert the value into a string reference.
bool convert(UInt16 &value, const ValueContainer &container) const noexcept override
Tries to convert the value into an integer.
void toStr(std::string &str, const ValueContainer &container) const override
Outputs the text presentation of the value stored in the given container into the given string.
static const ValueConverter & self() noexcept
bool convert(Int16 &value, const ValueContainer &container) const noexcept override
Tries to convert the value into an integer.
StrRef toStr(Char *, size_t, const ValueContainer &container) const noexcept override
bool convert(Char &value, const ValueContainer &container) const noexcept override
Tries to convert the value into a character.
const Char * typeName() const noexcept override
The name of the type whose values are manipulated through the given converter.
bool convert(UInt8 &value, const ValueContainer &container) const noexcept override
Tries to convert the value into an integer.
bool convert(Int32 &value, const ValueContainer &container) const noexcept override
Tries to convert the value into an integer.
bool convert(Int8 &value, const ValueContainer &container) const noexcept override
Tries to convert the value into an integer.
bool convert(Int64 &value, const ValueContainer &container) const noexcept override
Tries to convert the value into an integer.
bool convert(UInt32 &value, const ValueContainer &container) const noexcept override
Tries to convert the value into an integer.
bool convert(Decimal &value, const ValueContainer &container) const noexcept override
Tries to convert the value into a Decimal.
Implements the value conversion the Decimal fields.
void toStr(std::string &str, const ValueContainer &container) const override
Outputs the text presentation of the value stored in the given container into the given string.
StrRef toStr(Char *buf, size_t size, const ValueContainer &container) const override
static const ValueConverter & self() noexcept
const Char * typeName() const noexcept override
The name of the type whose values are manipulated through the given converter.
bool convert(Decimal &value, const ValueContainer &container) const noexcept override
Tries to convert the value into a Decimal.
Implements the value conversion for integer fields.
static const ValueConverter & self() noexcept
const Char * typeName() const noexcept override
The name of the type whose values are manipulated through the given converter.
Implements the value conversion for integer fields.
static const ValueConverter & self() noexcept
const Char * typeName() const noexcept override
The name of the type whose values are manipulated through the given converter.
Implements the value conversion for integer fields.
static const ValueConverter & self() noexcept
const Char * typeName() const noexcept override
The name of the type whose values are manipulated through the given converter.
Implements the value conversion for integer fields.
static const ValueConverter & self() noexcept
const Char * typeName() const noexcept override
The name of the type whose values are manipulated through the given converter.
Implements the value conversion for month-year fields.
void toStr(std::string &str, const ValueContainer &container) const override
Outputs the text presentation of the value stored in the given container into the given string.
const Char * typeName() const noexcept override
The name of the type whose values are manipulated through the given converter.
bool convert(MaturityMonthYear &value, const ValueContainer &container) const noexcept override
Tries to convert the value into a month-year.
static const ValueConverter & self() noexcept
const Char * typeName() const noexcept override
The name of the type whose values are manipulated through the given converter.
Implements the value conversion for text fields.
bool convert(UInt64 &value, const ValueContainer &container) const noexcept override
Tries to convert the value into an integer.
bool convert(StrRef &ref, const ValueContainer &container) const noexcept override
Tries to convert the value into a string reference.
bool convert(UInt16 &value, const ValueContainer &container) const noexcept override
Tries to convert the value into an integer.
void toStr(std::string &str, const ValueContainer &container) const override
Outputs the text presentation of the value stored in the given container into the given string.
bool convert(Timestamp &value, const ValueContainer &container) const override
Tries to convert the value into a timestamp.
static const ValueConverter & self() noexcept
bool convert(Int16 &value, const ValueContainer &container) const noexcept override
Tries to convert the value into an integer.
StrRef toStr(Char *, size_t, const ValueContainer &container) const noexcept override
bool convert(Char &value, const ValueContainer &container) const noexcept override
Tries to convert the value into a character.
const Char * typeName() const noexcept override
The name of the type whose values are manipulated through the given converter.
bool convert(UInt8 &value, const ValueContainer &container) const noexcept override
Tries to convert the value into an integer.
bool convert(Int32 &value, const ValueContainer &container) const noexcept override
Tries to convert the value into an integer.
bool convert(Int8 &value, const ValueContainer &container) const noexcept override
Tries to convert the value into an integer.
bool convert(Int64 &value, const ValueContainer &container) const noexcept override
Tries to convert the value into an integer.
bool convert(UInt32 &value, const ValueContainer &container) const noexcept override
Tries to convert the value into an integer.
bool convert(Decimal &value, const ValueContainer &container) const noexcept override
Tries to convert the value into a Decimal.
Implements the value conversion for Timestamp fields.
bool convert(UInt64 &value, const ValueContainer &container) const noexcept override
Tries to convert the value into an integer.
void toStr(std::string &str, const ValueContainer &container) const override
Outputs the text presentation of the value stored in the given container into the given string.
StrRef toStr(Char *buf, size_t size, const ValueContainer &container) const override
static const ValueConverter & self() noexcept
bool convert(Timestamp &value, const ValueContainer &container) const noexcept override
Tries to convert the value into a timestamp.
const Char * typeName() const noexcept override
The name of the type whose values are manipulated through the given converter.
bool convert(Int64 &value, const ValueContainer &container) const noexcept override
Tries to convert the value into an integer.
Implements the value conversion for integer fields.
static const ValueConverter & self() noexcept
const Char * typeName() const noexcept override
The name of the type whose values are manipulated through the given converter.
Implements the value conversion for integer fields.
static const ValueConverter & self() noexcept
const Char * typeName() const noexcept override
The name of the type whose values are manipulated through the given converter.
Implements the value conversion for integer fields.
static const ValueConverter & self() noexcept
const Char * typeName() const noexcept override
The name of the type whose values are manipulated through the given converter.
Implements the value conversion for integer fields.
static const ValueConverter & self() noexcept
const Char * typeName() const noexcept override
The name of the type whose values are manipulated through the given converter.
static BitSet convert(const ValueConverter &converter, const ValueContainer &container)
Converters the given value by using the specified value converter and returns the result of conversio...
static bool convert(BitSet &result, const ValueConverter &converter, const ValueContainer &container)
Tries to convert the given value using the given value converter and puts the result of the conversio...
static Result convert(const ValueConverter &converter, const ValueContainer &container)
Converters the given value by using the specified value converter and returns the result of conversio...
static bool convert(Result &result, const ValueConverter &converter, const ValueContainer &container)
Tries to convert the given value using the given value converter and puts the result of the conversio...
Field value traits used in conversion operations.
static Result convert(const ValueConverter &converter, const ValueContainer &container)
Converters the given value by using the specified value converter.
static bool convert(Result &result, const ValueConverter &converter, const ValueContainer &container)
Tries to convert the given value using the given value converter and puts the result of the conversio...
Implements value conversion operations through value conversion traits.
ValueConversionTraits< Value, ValueKind< Value >::Kind > Traits
Conversion traits.
Abstraction gathering operations over a value of a particular type stored as a field in a message.
virtual bool convert(UInt16 &, const ValueContainer &) const noexcept
Tries to convert the value into an integer.
virtual bool convert(MaturityMonthYear &, const ValueContainer &) const noexcept
Tries to convert the value into a month-year.
virtual bool convert(UInt8 &, const ValueContainer &) const noexcept
Tries to convert the value into an integer.
virtual bool convert(UInt32 &, const ValueContainer &) const noexcept
Tries to convert the value into an integer.
virtual void toStr(std::string &, const ValueContainer &) const
Outputs the text presentation of the value stored in the given container into the given string.
virtual bool convert(Timestamp &, const ValueContainer &) const
Tries to convert the value into a timestamp.
virtual bool convert(UInt64 &, const ValueContainer &) const noexcept
Tries to convert the value into an integer.
virtual StrRef toStr(Char *, size_t, const ValueContainer &) const
virtual bool convert(Char &, const ValueContainer &) const noexcept
Tries to convert the value into a character.
virtual bool convert(Int8 &, const ValueContainer &) const noexcept
Tries to convert the value into an integer.
virtual const Char * typeName() const noexcept=0
The name of the type whose values are manipulated through the given converter.
virtual bool convert(StrRef &, const ValueContainer &) const noexcept
Tries to convert the value into a string reference.
virtual bool convert(Decimal &, const ValueContainer &) const noexcept
Tries to convert the value into a Decimal.
virtual bool convert(Int32 &, const ValueContainer &) const noexcept
Tries to convert the value into an integer.
virtual bool convert(Int64 &, const ValueContainer &) const noexcept
Tries to convert the value into an integer.
virtual bool convert(Int16 &, const ValueContainer &) const noexcept
Tries to convert the value into an integer.
Identifies the kind of the field value.