182 ref = container.get<
StrRef>();
197 else if (str.
empty())
296 str.append(1, container.get<
Char>());
315 return charToDigit(
value, container.get<
Char>());
320 return charToDigit(
value, container.get<
Char>());
325 return charToDigit(
value, container.get<
Char>());
330 return charToDigit(
value, container.get<
Char>());
335 return charToDigit(
value, container.get<
Char>());
340 return charToDigit(
value, container.get<
Char>());
345 return charToDigit(
value, container.get<
Char>());
350 return charToDigit(
value, container.get<
Char>());
357 if (charToDigit(mantissa, container.get<
Char>()))
380 template <
class Integer>
381 static bool charToDigit(Integer& converted,
Char original)
383 if (
'0' <= original &&
'9' >= original)
385 converted =
static_cast<Integer
>(original -
'0');
398template <
class Integer,
class Descendant>
401 template <
class Integral,
bool IsSigned>
404 bool operator()(Integral
value)
const
410 template <
class Integral>
411 struct FitsToChar<Integral, false>
413 bool operator()(Integral
value)
const
419 typedef FitsToChar<Integer, !(static_cast<Integer>(-1) >
static_cast<Integer
>(0))> CanFitToChar;
429 const Integer actual = container.get<Integer>();
431 if (CanFitToChar()(actual))
443 value =
static_cast<Int8>(container.get<Integer>());
450 value =
static_cast<UInt8>(container.get<Integer>());
457 value =
static_cast<Int16>(container.get<Integer>());
464 value =
static_cast<UInt16>(container.get<Integer>());
471 value =
static_cast<Int32>(container.get<Integer>());
478 value =
static_cast<UInt32>(container.get<Integer>());
485 value =
static_cast<Int64
>(container.get<Integer>());
492 value =
static_cast<UInt64>(container.get<Integer>());
796 return "MaturityMonthYear";
878 issue +=
"Cannot transform ";
880 issue += typeName ? typeName :
"Unknown type";
882 issue +=
" value to the value of the requested "
883 "type because either conversion between "
884 "types does not exist or the value cannot "
885 "be fit to the value of the target type. ";
887 throw std::domain_error(issue);
903template <
class Value>
906 typedef char Ordinary[1];
908 typedef char Enumeration[2];
910 typedef char Bits[3];
912 template <
class Other>
913 static Bits& kind(
typename Other::Bits*);
915 template <
class Other>
916 static Enumeration& kind(
typename Other::Enum*);
918 template <
class Other>
919 static Ordinary& kind(...);
934template <
class Value,
int>
948 if (!converter.
convert(result, container))
962 return converter.
convert(result, container);
970template <
class Enumeration>
974 typedef typename Enumeration::Enum
Result;
982 typename Enumeration::Base result;
984 if (!converter.
convert(result, container))
989 return static_cast<Result>(result);
998 typename Enumeration::Base base;
1000 if (converter.
convert(base, container))
1002 result =
static_cast<Result>(base);
1015template <
class BitSet>
1027 typename BitSet::Bits bits;
1029 if (!converter.
convert(bits, container))
1034 return BitSet(bits);
1043 typename BitSet::Bits bits;
1045 if (converter.
convert(bits, container))
1047 result = BitSet(bits);
1058template <
class Value>
#define ONIXS_CMEMDHFIX_NAMESPACE_BEGIN
#define ONIXS_CMEMDHFIX_NAMESPACE_END
#define ONIXS_CMEMDH_NULLPTR
#define ONIXS_CMEMDH_EXPORTED
#define ONIXS_CMEMDH_OVERRIDE
A real number with floating exponent.
DecimalMantissa Mantissa
Aliases mantissa component type.
bool convert(Int64 &value, const ValueContainer &container) const override
bool convert(UInt8 &value, const ValueContainer &container) const override
void toStr(std::string &str, const ValueContainer &container) const override
bool convert(Int16 &value, const ValueContainer &container) const override
bool convert(UInt32 &value, const ValueContainer &container) const override
bool convert(Decimal &value, const ValueContainer &container) const override
bool convert(UInt64 &value, const ValueContainer &container) const override
bool convert(Int8 &value, const ValueContainer &container) const override
bool convert(Timestamp &, const ValueContainer &) const override
bool convert(StrRef &, const ValueContainer &) const override
bool convert(MaturityMonthYear &, const ValueContainer &) const override
bool convert(Int32 &value, const ValueContainer &container) const override
bool convert(UInt16 &value, const ValueContainer &container) const override
bool convert(Char &value, const ValueContainer &container) const override
Container for a value of any supported kinds.
Traits class used identify a field value kind.
@ Kind
The kind of the given field value by its type.
const Char * items() const
Read-only content.
size_t size() const
Number of chars.
bool empty() const
Indicates whether the referenced text is empty.
Represents time point without time-zone information.
Ticks sinceEpoch() const
Number of nanoseconds since the Epoch (01-01-1970).
void throwBadConversion(const Char *typeName)
bool value(Number &number, const MultiContainer &container, Tag tag)
bool fromStr(Decimal &, const Char *, size_t)
char Char
Character type alias.
void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.
bool convert(Int64 &value, const ValueContainer &container) const override
bool convert(UInt8 &value, const ValueContainer &container) const override
void toStr(std::string &str, const ValueContainer &container) const override
bool convert(Int16 &value, const ValueContainer &container) const override
bool convert(UInt32 &value, const ValueContainer &container) const override
bool convert(Decimal &value, const ValueContainer &container) const override
bool convert(UInt64 &value, const ValueContainer &container) const override
bool convert(Int8 &value, const ValueContainer &container) const override
bool convert(Timestamp &, const ValueContainer &) const override
const Char * typeName() const override
bool convert(MaturityMonthYear &, const ValueContainer &) const override
bool convert(Int32 &value, const ValueContainer &container) const override
bool convert(UInt16 &value, const ValueContainer &container) const override
bool convert(StrRef &ref, const ValueContainer &container) const override
bool convert(Char &value, const ValueContainer &container) const override
static const ValueConverter & self()
bool convert(UInt32 &, const ValueContainer &) const override
void toStr(std::string &str, const ValueContainer &container) const override
bool convert(UInt8 &, const ValueContainer &) const override
bool convert(Int8 &, const ValueContainer &) const override
bool convert(Decimal &value, const ValueContainer &container) const override
bool convert(Int64 &, const ValueContainer &) const override
bool convert(Timestamp &, const ValueContainer &) const override
bool convert(Int16 &, const ValueContainer &) const override
const Char * typeName() const override
bool convert(StrRef &, const ValueContainer &) const override
bool convert(UInt64 &, const ValueContainer &) const override
bool convert(MaturityMonthYear &, const ValueContainer &) const override
bool convert(Int32 &, const ValueContainer &) const override
bool convert(Char &, const ValueContainer &) const override
bool convert(UInt16 &, const ValueContainer &) const override
static const ValueConverter & self()
const Char * typeName() const override
static const ValueConverter & self()
const Char * typeName() const override
static const ValueConverter & self()
const Char * typeName() const override
static const ValueConverter & self()
const Char * typeName() const override
static const ValueConverter & self()
bool convert(UInt32 &, const ValueContainer &) const override
void toStr(std::string &str, const ValueContainer &container) const override
bool convert(UInt8 &, const ValueContainer &) const override
bool convert(Int8 &, const ValueContainer &) const override
bool convert(Int64 &, const ValueContainer &) const override
bool convert(Decimal &, const ValueContainer &) const override
bool convert(MaturityMonthYear &value, const ValueContainer &container) const override
bool convert(Timestamp &, const ValueContainer &) const override
bool convert(Int16 &, const ValueContainer &) const override
const Char * typeName() const override
bool convert(StrRef &, const ValueContainer &) const override
bool convert(UInt64 &, const ValueContainer &) const override
bool convert(Int32 &, const ValueContainer &) const override
bool convert(Char &, const ValueContainer &) const override
bool convert(UInt16 &, const ValueContainer &) const override
static const ValueConverter & self()
const Char * typeName() const override
static const ValueConverter & self()
bool convert(Int64 &value, const ValueContainer &container) const override
bool convert(UInt8 &value, const ValueContainer &container) const override
void toStr(std::string &str, const ValueContainer &container) const override
bool convert(Int16 &value, const ValueContainer &container) const override
bool convert(Timestamp &value, const ValueContainer &container) const override
bool convert(UInt32 &value, const ValueContainer &container) const override
bool convert(Decimal &value, const ValueContainer &container) const override
bool convert(UInt64 &value, const ValueContainer &container) const override
bool convert(Int8 &value, const ValueContainer &container) const override
const Char * typeName() const override
bool convert(MaturityMonthYear &, const ValueContainer &) const override
bool convert(Int32 &value, const ValueContainer &container) const override
bool convert(UInt16 &value, const ValueContainer &container) const override
bool convert(StrRef &ref, const ValueContainer &container) const override
bool convert(Char &value, const ValueContainer &container) const override
static const ValueConverter & self()
bool convert(Int64 &value, const ValueContainer &container) const override
bool convert(UInt32 &, const ValueContainer &) const override
void toStr(std::string &str, const ValueContainer &container) const override
bool convert(UInt8 &, const ValueContainer &) const override
bool convert(Timestamp &value, const ValueContainer &container) const override
bool convert(Int8 &, const ValueContainer &) const override
bool convert(UInt64 &value, const ValueContainer &container) const override
bool convert(Decimal &, const ValueContainer &) const override
bool convert(Int16 &, const ValueContainer &) const override
const Char * typeName() const override
bool convert(StrRef &, const ValueContainer &) const override
bool convert(MaturityMonthYear &, const ValueContainer &) const override
bool convert(Int32 &, const ValueContainer &) const override
bool convert(Char &, const ValueContainer &) const override
bool convert(UInt16 &, const ValueContainer &) const override
static const ValueConverter & self()
const Char * typeName() const override
static const ValueConverter & self()
const Char * typeName() const override
static const ValueConverter & self()
const Char * typeName() const override
static const ValueConverter & self()
const Char * typeName() const override
static const ValueConverter & self()
static BitSet convert(const ValueConverter &converter, const ValueContainer &container)
static bool convert(BitSet &result, const ValueConverter &converter, const ValueContainer &container)
BitSet Result
Type of the conversion output.
Enumeration::Enum Result
Type of the conversion output.
static Result convert(const ValueConverter &converter, const ValueContainer &container)
static bool convert(Result &result, const ValueConverter &converter, const ValueContainer &container)
static Result convert(const ValueConverter &converter, const ValueContainer &container)
Value Result
Type of the conversion output.
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(StrRef &, const ValueContainer &) const
virtual void toStr(std::string &, const ValueContainer &) const
virtual bool convert(MaturityMonthYear &, const ValueContainer &) const
virtual bool convert(UInt64 &, const ValueContainer &) const
virtual bool convert(Timestamp &, const ValueContainer &) const
virtual bool convert(UInt16 &, const ValueContainer &) const
virtual bool convert(UInt32 &, const ValueContainer &) const
virtual bool convert(UInt8 &, const ValueContainer &) const
virtual bool convert(Int16 &, const ValueContainer &) const
virtual bool convert(Int32 &, const ValueContainer &) const
virtual const Char * typeName() const =0
virtual bool convert(Decimal &, const ValueContainer &) const
virtual bool convert(Char &, const ValueContainer &) const
virtual bool convert(Int8 &, const ValueContainer &) const
virtual bool convert(Int64 &, const ValueContainer &) const
Identifies kinds of FIX field values.
Enum
Identifies kinds of FIX field values.