OnixS C++ CME MDP Premium Market Data Handler 5.10.2
Users' manual and 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
40{
43 virtual const Char* typeName() const noexcept = 0;
44
47 virtual void toStr(std::string&, const ValueContainer&) const {}
48
50 virtual StrRef toStr(Char*, size_t, const ValueContainer&) const
51 {
52 throwBadConversion(typeName());
53 }
54
58 virtual bool convert(StrRef&, const ValueContainer&) const noexcept
59 {
60 return false;
61 }
62
63 template <class StringRef>
64 bool convert(StringRef& ref, const ValueContainer& container) const
65 {
66 StrRef converted;
67
68 if (convert(converted, container))
69 {
70 ref = StringRef(converted);
71
72 return true;
73 }
74
75 return false;
76 }
77
81 virtual bool convert(Char&, const ValueContainer&) const noexcept
82 {
83 return false;
84 }
85
89 virtual bool convert(Int8&, const ValueContainer&) const noexcept
90 {
91 return false;
92 }
93
97 virtual bool convert(UInt8&, const ValueContainer&) const noexcept
98 {
99 return false;
100 }
101
105 virtual bool convert(Int16&, const ValueContainer&) const noexcept
106 {
107 return false;
108 }
109
113 virtual bool convert(UInt16&, const ValueContainer&) const noexcept
114 {
115 return false;
116 }
117
121 virtual bool convert(Int32&, const ValueContainer&) const noexcept
122 {
123 return false;
124 }
125
129 virtual bool convert(UInt32&, const ValueContainer&) const noexcept
130 {
131 return false;
132 }
133
137 virtual bool convert(Int64&, const ValueContainer&) const noexcept
138 {
139 return false;
140 }
141
145 virtual bool convert(UInt64&, const ValueContainer&) const noexcept
146 {
147 return false;
148 }
149
153 virtual bool convert(Decimal&, const ValueContainer&) const noexcept
154 {
155 return false;
156 }
157
161 virtual bool convert(Timestamp&, const ValueContainer&) const
162 {
163 return false;
164 }
165
169 virtual bool convert(MaturityMonthYear&, const ValueContainer&) const noexcept
170 {
171 return false;
172 }
173
175};
176
178{
179 ONIXS_CMEMDH_NODISCARD const Char* typeName() const noexcept override
180 {
181 return "Null";
182 }
183
185
186 ~NullConverter() = default;
187};
188
191{
193
194 ONIXS_CMEMDH_NODISCARD const Char* typeName() const noexcept override
195 {
196 return "String";
197 }
198
199 void toStr(std::string& str, const ValueContainer& container) const override
200 {
201 const StrRef& ref = container.get<StrRef>();
202
203 str.assign(ref.data(), ref.size());
204 }
205
206 StrRef toStr(Char*, size_t, const ValueContainer& container) const noexcept override
207 {
208 return container.get<StrRef>();
209 }
210
211 bool convert(StrRef& ref, const ValueContainer& container) const noexcept override
212 {
213 ref = container.get<StrRef>();
214
215 return true;
216 }
217
218 bool convert(Char& value, const ValueContainer& container) const noexcept override
219 {
220 const StrRef& str = container.get<StrRef>();
221
222 if (1 == str.size())
223 {
224 value = str[0];
225
226 return true;
227 }
228 else if (str.empty())
229 {
230 value = 0;
231
232 return true;
233 }
234
235 return false;
236 }
237
238 bool convert(Int8& value, const ValueContainer& container) const noexcept override
239 {
240 const StrRef& str = container.get<StrRef>();
241
242 return fromStr(value, str.data(), str.size());
243 }
244
245 bool convert(UInt8& value, const ValueContainer& container) const noexcept override
246 {
247 const StrRef& str = container.get<StrRef>();
248
249 return fromStr(value, str.data(), str.size());
250 }
251
252 bool convert(Int16& value, const ValueContainer& container) const noexcept override
253 {
254 const StrRef& str = container.get<StrRef>();
255
256 return fromStr(value, str.data(), str.size());
257 }
258
259 bool convert(UInt16& value, const ValueContainer& container) const noexcept override
260 {
261 const StrRef& str = container.get<StrRef>();
262
263 return fromStr(value, str.data(), str.size());
264 }
265
266 bool convert(Int32& value, const ValueContainer& container) const noexcept override
267 {
268 const StrRef& str = container.get<StrRef>();
269
270 return fromStr(value, str.data(), str.size());
271 }
272
273 bool convert(UInt32& value, const ValueContainer& container) const noexcept override
274 {
275 const StrRef& str = container.get<StrRef>();
276
277 return fromStr(value, str.data(), str.size());
278 }
279
280 bool convert(Int64& value, const ValueContainer& container) const noexcept override
281 {
282 const StrRef& str = container.get<StrRef>();
283
284 return fromStr(value, str.data(), str.size());
285 }
286
287 bool convert(UInt64& value, const ValueContainer& container) const noexcept override
288 {
289 const StrRef& str = container.get<StrRef>();
290
291 return fromStr(value, str.data(), str.size());
292 }
293
294 bool convert(Decimal& value, const ValueContainer& container) const noexcept override
295 {
296 const StrRef& str = container.get<StrRef>();
297
298 return fromStr(value, str.data(), str.size());
299 }
300
301 bool convert(Timestamp& value, const ValueContainer& container) const override
302 {
303 const StrRef& str = container.get<StrRef>();
304
305 return fromStr(value, str.data(), str.size());
306 }
307
308 static const ValueConverter& self() noexcept;
309
310 ~StrRefConverter() = default;
311};
312
313//
314
318{
320
321 ONIXS_CMEMDH_NODISCARD const Char* typeName() const noexcept override
322 {
323 return "Char";
324 }
325
326 void toStr(std::string& str, const ValueContainer& container) const override
327 {
328 str.append(1, container.get<Char>());
329 }
330
331 StrRef toStr(Char*, size_t, const ValueContainer& container) const noexcept override
332 {
333 return StrRef(&container.get<Char>(), 1);
334 }
335
336 bool convert(StrRef& ref, const ValueContainer& container) const noexcept override
337 {
338 ref = StrRef(&container.get<Char>(), 1);
339
340 return true;
341 }
342
343 bool convert(Char& value, const ValueContainer& container) const noexcept override
344 {
345 value = container.get<Char>();
346
347 return true;
348 }
349
350 bool convert(Int8& value, const ValueContainer& container) const noexcept override
351 {
352 return charToDigit(value, container.get<Char>());
353 }
354
355 bool convert(UInt8& value, const ValueContainer& container) const noexcept override
356 {
357 return charToDigit(value, container.get<Char>());
358 }
359
360 bool convert(Int16& value, const ValueContainer& container) const noexcept override
361 {
362 return charToDigit(value, container.get<Char>());
363 }
364
365 bool convert(UInt16& value, const ValueContainer& container) const noexcept override
366 {
367 return charToDigit(value, container.get<Char>());
368 }
369
370 bool convert(Int32& value, const ValueContainer& container) const noexcept override
371 {
372 return charToDigit(value, container.get<Char>());
373 }
374
375 bool convert(UInt32& value, const ValueContainer& container) const noexcept override
376 {
377 return charToDigit(value, container.get<Char>());
378 }
379
380 bool convert(Int64& value, const ValueContainer& container) const noexcept override
381 {
382 return charToDigit(value, container.get<Char>());
383 }
384
385 bool convert(UInt64& value, const ValueContainer& container) const noexcept override
386 {
387 return charToDigit(value, container.get<Char>());
388 }
389
390 bool convert(Decimal& value, const ValueContainer& container) const noexcept override
391 {
392 Decimal::Mantissa mantissa;
393
394 if (charToDigit(mantissa, container.get<Char>()))
395 {
396 value = Decimal(mantissa, 0);
397
398 return true;
399 }
400
401 return false;
402 }
403
404 static const ValueConverter& self() noexcept;
405
406 ~CharConverter() = default;
407
408private:
409 template <class Integer>
410 static bool charToDigit(Integer& converted, Char original) noexcept
411 {
412 if ('0' <= original && '9' >= original)
413 {
414 converted = static_cast<Integer>(original - '0');
415
416 return true;
417 }
418
419 return false;
420 }
421};
422
424template <class Integer, class Descendant = void>
426{
427 template <class Integral, bool IsSigned>
428 struct FitsToChar
429 {
430 bool operator()(Integral value) const noexcept
431 {
432 return (0 <= value && value < 10);
433 }
434 };
435
436 template <class Integral>
437 struct FitsToChar<Integral, false>
438 {
439 bool operator()(Integral value) const noexcept
440 {
441 return (value < 10);
442 }
443 };
444
445 typedef FitsToChar<Integer, !(static_cast<Integer>(-1) > static_cast<Integer>(0))> CanFitToChar;
446
447public:
449
450 void toStr(std::string& str, const ValueContainer& container) const override
451 {
452 ONIXS_CMEMDH_MESSAGING_NAMESPACE::toStr(str, container.get<Integer>());
453 }
454
455 StrRef toStr(Char* buf, size_t size, const ValueContainer& container) const override
456 {
457 assert(buf);
458
459 const size_t converted = ONIXS_CMEMDH_MESSAGING_NAMESPACE::toStr(container.get<Integer>(), buf, size);
460
461 assert(converted < size);
462 assert(converted != 0);
463
464 return StrRef(buf, converted);
465 }
466
467 bool convert(Char& value, const ValueContainer& container) const noexcept override
468 {
469 const Integer actual = container.get<Integer>();
470
471 if (CanFitToChar()(actual))
472 {
473 value = static_cast<Char>('0' + actual);
474
475 return true;
476 }
477
478 return false;
479 }
480
481 bool convert(Int8& value, const ValueContainer& container) const noexcept override
482 {
483 value = numericCast<Int8>(container.get<Integer>());
484
485 return true;
486 }
487
488 bool convert(UInt8& value, const ValueContainer& container) const noexcept override
489 {
490 value = numericCast<UInt8>(container.get<Integer>());
491
492 return true;
493 }
494
495 bool convert(Int16& value, const ValueContainer& container) const noexcept override
496 {
497 value = numericCast<Int16>(container.get<Integer>());
498
499 return true;
500 }
501
502 bool convert(UInt16& value, const ValueContainer& container) const noexcept override
503 {
504 value = numericCast<UInt16>(container.get<Integer>());
505
506 return true;
507 }
508
509 bool convert(Int32& value, const ValueContainer& container) const noexcept override
510 {
511 value = numericCast<Int32>(container.get<Integer>());
512
513 return true;
514 }
515
516 bool convert(UInt32& value, const ValueContainer& container) const noexcept override
517 {
518 value = numericCast<UInt32>(container.get<Integer>());
519
520 return true;
521 }
522
523 bool convert(Int64& value, const ValueContainer& container) const noexcept override
524 {
525 value = numericCast<Int64>(container.get<Integer>());
526
527 return true;
528 }
529
530 bool convert(UInt64& value, const ValueContainer& container) const noexcept override
531 {
532 value = numericCast<UInt64>(container.get<Integer>());
533
534 return true;
535 }
536
537 bool convert(Decimal& value, const ValueContainer& container) const noexcept override
538 {
539 value = Decimal(numericCast<Decimal::Mantissa>(container.get<Integer>()), 0);
540
541 return true;
542 }
543
544 bool convert(Timestamp& value, const ValueContainer& container) const noexcept override
545 {
546 value = makeTimestamp(numericCast<UInt64>(container.get<Integer>()));
547
548 return true;
549 }
550
551 ~IntegerConverter() = default;
552};
553
556{
557 ONIXS_CMEMDH_NODISCARD const Char* typeName() const noexcept override
558 {
559 return "Int8";
560 }
561
562 static const ValueConverter& self() noexcept;
563
564 ~Int8Converter() = default;
565};
566
569{
570 ONIXS_CMEMDH_NODISCARD const Char* typeName() const noexcept override
571 {
572 return "UInt8";
573 }
574
575 static const ValueConverter& self() noexcept;
576
577 ~UInt8Converter() = default;
578};
579
582{
583 ONIXS_CMEMDH_NODISCARD const Char* typeName() const noexcept override
584 {
585 return "Int16";
586 }
587
588 static const ValueConverter& self() noexcept;
589
590 ~Int16Converter() = default;
591};
592
595{
596 ONIXS_CMEMDH_NODISCARD const Char* typeName() const noexcept override
597 {
598 return "UInt16";
599 }
600
601 static const ValueConverter& self() noexcept;
602
603 ~UInt16Converter() = default;
604};
605
608{
609 ONIXS_CMEMDH_NODISCARD const Char* typeName() const noexcept override
610 {
611 return "Int32";
612 }
613
614 static const ValueConverter& self() noexcept;
615
616 ~Int32Converter() = default;
617};
618
621{
622 ONIXS_CMEMDH_NODISCARD const Char* typeName() const noexcept override
623 {
624 return "UInt32";
625 }
626
627 static const ValueConverter& self() noexcept;
628
629 ~UInt32Converter() = default;
630};
631
634{
635 ONIXS_CMEMDH_NODISCARD const Char* typeName() const noexcept override
636 {
637 return "Int64";
638 }
639
640 static const ValueConverter& self() noexcept;
641
642 ~Int64Converter() = default;
643};
644
647{
648 ONIXS_CMEMDH_NODISCARD const Char* typeName() const noexcept override
649 {
650 return "UInt64";
651 }
652
653 static const ValueConverter& self() noexcept;
654
655 ~UInt64Converter() = default;
656};
657
660{
662
663 ONIXS_CMEMDH_NODISCARD const Char* typeName() const noexcept override
664 {
665 return "Decimal";
666 }
667
668 void toStr(std::string& str, const ValueContainer& container) const override
669 {
670 ONIXS_CMEMDH_MESSAGING_NAMESPACE::toStr(str, container.get<Decimal>());
671 }
672
673 StrRef toStr(Char* buf, size_t size, const ValueContainer& container) const override
674 {
675 assert(buf);
676
677 const size_t converted = ONIXS_CMEMDH_MESSAGING_NAMESPACE::toStr(container.get<Decimal>(), buf, size);
678
679 assert(converted != 0);
680 assert(converted < size);
681
682 return StrRef(buf, converted);
683 }
684
685 bool convert(Decimal& value, const ValueContainer& container) const noexcept override
686 {
687 value = container.get<Decimal>();
688
689 return true;
690 }
691
692 static const ValueConverter& self() noexcept;
693
694 ~DecimalConverter() = default;
695};
696
697//
698
701{
703
704 ONIXS_CMEMDH_NODISCARD const Char* typeName() const noexcept override
705 {
706 return "Timestamp";
707 }
708
709 void toStr(std::string& str, const ValueContainer& container) const override
710 {
711 ONIXS_CMEMDH_MESSAGING_NAMESPACE::toStr(str, container.get<Timestamp>());
712 }
713
714 StrRef toStr(Char* buf, size_t size, const ValueContainer& container) const override
715 {
716 assert(buf);
717
718 const size_t converted = ONIXS_CMEMDH_MESSAGING_NAMESPACE::toStr(container.get<Timestamp>(), buf, size);
719
720 assert(converted < size);
721 assert(converted != 0);
722
723 return StrRef(buf, converted);
724 }
725
726 bool convert(Int64& value, const ValueContainer& container) const noexcept override
727 {
728 value = numericCast<Int64>(container.get<Timestamp>().sinceEpoch());
729
730 return true;
731 }
732
733 bool convert(UInt64& value, const ValueContainer& container) const noexcept override
734 {
735 value = container.get<Timestamp>().sinceEpoch();
736
737 return true;
738 }
739
740 bool convert(Timestamp& value, const ValueContainer& container) const noexcept override
741 {
742 value = container.get<Timestamp>();
743
744 return true;
745 }
746
747 static const ValueConverter& self() noexcept;
748
749 ~TimestampConverter() = default;
750};
751
754{
757
758 ONIXS_CMEMDH_NODISCARD const Char* typeName() const noexcept override
759 {
760 return "MaturityMonthYear";
761 }
762
763 void toStr(std::string& str, const ValueContainer& container) const override
764 {
765 ONIXS_CMEMDH_MESSAGING_NAMESPACE::toStr(str, container.get<MaturityMonthYear>());
766 }
767
768 bool convert(MaturityMonthYear& value, const ValueContainer& container) const noexcept override
769 {
770 value = container.get<MaturityMonthYear>();
771
772 return true;
773 }
774
775 static const ValueConverter& self() noexcept;
776
778};
779
782{
789};
790
792template <class Value>
794{
795 typedef char Ordinary[1];
796
797 typedef char Enumeration[2];
798
799 typedef char Bits[3];
800
801 template <class Other>
802 static Bits& kind(typename Other::Bits*);
803
804 template <class Other>
805 static Enumeration& kind(typename Other::Enum*);
806
807 template <class Other>
808 static Ordinary& kind(...);
809
810public:
811 enum
812 {
815 (sizeof(Bits) == sizeof(kind<Value>(nullptr))
817 : (sizeof(Enumeration) == sizeof(kind<Value>(nullptr)) ? ValueKinds::Enumeration : ValueKinds::Ordinary
818 ))
819 };
820};
821
823template <class Value, int>
825{
827 typedef Value Result;
828
835 static Result convert(const ValueConverter& converter, const ValueContainer& container)
836 {
837 Result result;
838
839 if (!converter.convert(result, container))
840 {
841 throwBadConversion(converter.typeName());
842 }
843
844 return result;
845 }
846
853 static bool convert(Result& result, const ValueConverter& converter, const ValueContainer& container)
854 {
855 return converter.convert(result, container);
856 }
857};
858
862template <class Enumeration>
863struct ValueConversionTraits<Enumeration, ValueKinds::Enumeration>
864{
866 typedef typename Enumeration::Enum Result;
867
872 static Result convert(const ValueConverter& converter, const ValueContainer& container)
873 {
874 typename Enumeration::Base result;
875
876 if (!converter.convert(result, container))
877 {
878 throwBadConversion(converter.typeName());
879 }
880
881 return static_cast<Result>(result);
882 }
883
888 static bool convert(Result& result, const ValueConverter& converter, const ValueContainer& container)
889 {
890 typename Enumeration::Base base;
891
892 if (converter.convert(base, container))
893 {
894 result = static_cast<Result>(base);
895
896 return true;
897 }
898
899 return false;
900 }
901};
902
907template <class BitSet>
909{
911 typedef BitSet Result;
912
917 static BitSet convert(const ValueConverter& converter, const ValueContainer& container)
918 {
919 typename BitSet::Bits bits;
920
921 if (!converter.convert(bits, container))
922 {
923 throwBadConversion(converter.typeName());
924 }
925
926 return BitSet(bits);
927 }
928
933 static bool convert(BitSet& result, const ValueConverter& converter, const ValueContainer& container)
934 {
935 typename BitSet::Bits bits;
936
937 if (converter.convert(bits, container))
938 {
939 result = BitSet(bits);
940
941 return true;
942 }
943
944 return false;
945 }
946};
947
950template <class Value>
952{
955
957 typedef typename Traits::Result Result;
958
961 typename Traits::Result operator()(const ValueConverter& converter, const ValueContainer& container) const
962 {
963 return Traits::convert(converter, container);
964 }
965
968 bool
969 operator()(typename Traits::Result& result, const ValueConverter& converter, const ValueContainer& container) const
970 {
971 return Traits::convert(result, converter, container);
972 }
973};
974
#define ONIXS_CMEMDH_MESSAGING_TAGBASED_NAMESPACE_BEGIN
Definition Bootstrap.h:60
#define ONIXS_CMEMDH_MESSAGING_TAGBASED_NAMESPACE_END
Definition Bootstrap.h:61
#define ONIXS_CMEMDH_EXPORTED
Definition Compiler.h:148
#define ONIXS_CMEMDH_NODISCARD
Definition Compiler.h:150
Implements the value conversion for integer fields.
bool convert(UInt64 &value, const ValueContainer &container) const noexcept override
bool convert(UInt16 &value, const ValueContainer &container) const noexcept override
void toStr(std::string &str, const ValueContainer &container) const override
StrRef toStr(Char *buf, size_t size, const ValueContainer &container) const override
bool convert(Int16 &value, const ValueContainer &container) const noexcept override
bool convert(Timestamp &value, const ValueContainer &container) const noexcept override
bool convert(Char &value, const ValueContainer &container) const noexcept override
bool convert(UInt8 &value, const ValueContainer &container) const noexcept override
bool convert(Int32 &value, const ValueContainer &container) const noexcept override
bool convert(Int8 &value, const ValueContainer &container) const noexcept override
bool convert(Int64 &value, const ValueContainer &container) const noexcept override
bool convert(UInt32 &value, const ValueContainer &container) const noexcept override
bool convert(Decimal &value, const ValueContainer &container) const noexcept override
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:425
Ticks sinceEpoch() const noexcept
Definition Time.h:574
bool value(Number &number, const MultiContainer &container, Tag tag)
Timestamp makeTimestamp(Timestamp::Ticks ticks) noexcept
Make Timestamp helper.
Definition Time.h:635
bool fromStr(Int8 &, const Char *, size_t)
std::uint32_t UInt32
uInt32.
Definition Integral.h:35
std::int8_t Int8
int8.
Definition Integral.h:30
char Char
Character type alias.
Definition String.h:30
std::uint16_t UInt16
uInt16.
Definition Integral.h:33
std::int32_t Int32
int32.
Definition Integral.h:34
std::basic_string_view< Char > StrRef
Definition StrRef.h:46
FloatingPointDecimal< DecimalMantissa, DecimalExponent > Decimal
Universal decimal type.
std::uint64_t UInt64
uInt64.
Definition Integral.h:37
std::uint8_t UInt8
uInt8.
Definition Integral.h:31
std::int16_t Int16
int16.
Definition Integral.h:32
bool convert(UInt64 &value, const ValueContainer &container) const noexcept override
bool convert(StrRef &ref, const ValueContainer &container) const noexcept override
bool convert(UInt16 &value, const ValueContainer &container) const noexcept override
void toStr(std::string &str, const ValueContainer &container) const override
static const ValueConverter & self() noexcept
bool convert(Int16 &value, const ValueContainer &container) const noexcept override
StrRef toStr(Char *, size_t, const ValueContainer &container) const noexcept override
bool convert(Char &value, const ValueContainer &container) const noexcept override
const Char * typeName() const noexcept override
bool convert(UInt8 &value, const ValueContainer &container) const noexcept override
bool convert(Int32 &value, const ValueContainer &container) const noexcept override
bool convert(Int8 &value, const ValueContainer &container) const noexcept override
bool convert(Int64 &value, const ValueContainer &container) const noexcept override
bool convert(UInt32 &value, const ValueContainer &container) const noexcept override
bool convert(Decimal &value, const ValueContainer &container) const noexcept override
Implements the value conversion the Decimal fields.
void toStr(std::string &str, const ValueContainer &container) const override
StrRef toStr(Char *buf, size_t size, const ValueContainer &container) const override
static const ValueConverter & self() noexcept
const Char * typeName() const noexcept override
bool convert(Decimal &value, const ValueContainer &container) const noexcept override
Implements the value conversion for integer fields.
static const ValueConverter & self() noexcept
const Char * typeName() const noexcept override
Implements the value conversion for integer fields.
static const ValueConverter & self() noexcept
const Char * typeName() const noexcept override
Implements the value conversion for integer fields.
static const ValueConverter & self() noexcept
const Char * typeName() const noexcept override
Implements the value conversion for integer fields.
static const ValueConverter & self() noexcept
const Char * typeName() const noexcept override
Implements the value conversion for month-year fields.
void toStr(std::string &str, const ValueContainer &container) const override
static const ValueConverter & self() noexcept
bool convert(MaturityMonthYear &value, const ValueContainer &container) const noexcept override
static const ValueConverter & self() noexcept
const Char * typeName() const noexcept override
Implements the value conversion for text fields.
bool convert(UInt64 &value, const ValueContainer &container) const noexcept override
bool convert(StrRef &ref, const ValueContainer &container) const noexcept override
bool convert(UInt16 &value, const ValueContainer &container) const noexcept override
void toStr(std::string &str, const ValueContainer &container) const override
bool convert(Timestamp &value, const ValueContainer &container) const override
static const ValueConverter & self() noexcept
bool convert(Int16 &value, const ValueContainer &container) const noexcept override
StrRef toStr(Char *, size_t, const ValueContainer &container) const noexcept override
bool convert(Char &value, const ValueContainer &container) const noexcept override
const Char * typeName() const noexcept override
bool convert(UInt8 &value, const ValueContainer &container) const noexcept override
bool convert(Int32 &value, const ValueContainer &container) const noexcept override
bool convert(Int8 &value, const ValueContainer &container) const noexcept override
bool convert(Int64 &value, const ValueContainer &container) const noexcept override
bool convert(UInt32 &value, const ValueContainer &container) const noexcept override
bool convert(Decimal &value, const ValueContainer &container) const noexcept override
Implements the value conversion for Timestamp fields.
bool convert(UInt64 &value, const ValueContainer &container) const noexcept override
void toStr(std::string &str, const ValueContainer &container) const override
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
const Char * typeName() const noexcept override
bool convert(Int64 &value, const ValueContainer &container) const noexcept override
Implements the value conversion for integer fields.
static const ValueConverter & self() noexcept
const Char * typeName() const noexcept override
Implements the value conversion for integer fields.
static const ValueConverter & self() noexcept
const Char * typeName() const noexcept override
Implements the value conversion for integer fields.
static const ValueConverter & self() noexcept
const Char * typeName() const noexcept override
Implements the value conversion for integer fields.
static const ValueConverter & self() noexcept
const Char * typeName() const noexcept override
static BitSet convert(const ValueConverter &converter, const ValueContainer &container)
static bool convert(BitSet &result, const ValueConverter &converter, const ValueContainer &container)
static Result convert(const ValueConverter &converter, const ValueContainer &container)
static bool convert(Result &result, const ValueConverter &converter, const ValueContainer &container)
Field value traits used in conversion operations.
static Result convert(const ValueConverter &converter, const ValueContainer &container)
static bool convert(Result &result, const ValueConverter &converter, const ValueContainer &container)
bool operator()(typename Traits::Result &result, const ValueConverter &converter, const ValueContainer &container) const
Traits::Result Result
Conversion output type.
ValueConversionTraits< Value, ValueKind< Value >::Kind > Traits
Conversion traits.
Traits::Result operator()(const ValueConverter &converter, const ValueContainer &container) const
virtual bool convert(UInt16 &, const ValueContainer &) const noexcept
virtual bool convert(MaturityMonthYear &, const ValueContainer &) const noexcept
virtual bool convert(UInt8 &, const ValueContainer &) const noexcept
virtual bool convert(UInt32 &, const ValueContainer &) const noexcept
virtual void toStr(std::string &, const ValueContainer &) const
virtual bool convert(Timestamp &, const ValueContainer &) const
virtual bool convert(UInt64 &, const ValueContainer &) const noexcept
virtual StrRef toStr(Char *, size_t, const ValueContainer &) const
virtual bool convert(Char &, const ValueContainer &) const noexcept
virtual bool convert(Int8 &, const ValueContainer &) const noexcept
virtual const Char * typeName() const noexcept=0
bool convert(StringRef &ref, const ValueContainer &container) const
virtual bool convert(StrRef &, const ValueContainer &) const noexcept
virtual bool convert(Decimal &, const ValueContainer &) const noexcept
virtual bool convert(Int32 &, const ValueContainer &) const noexcept
virtual bool convert(Int64 &, const ValueContainer &) const noexcept
virtual bool convert(Int16 &, const ValueContainer &) const noexcept
Identifies the kind of the field value.