diff options
| author | Vasile Vilvoiu <vasi@vilvoiu.ro> | 2021-07-21 18:32:58 +0300 |
|---|---|---|
| committer | Vasile Vilvoiu <vasi@vilvoiu.ro> | 2021-07-21 18:32:58 +0300 |
| commit | 1f59802058d1b8fbd51b9f01bd400625773e714f (patch) | |
| tree | 4028fe2d12af74059923fe2b694780f8cc10cebb | |
| parent | 5ac2df934fd908b8be4509484edb4f369b910999 (diff) | |
Input parser template instantiation.
Using std:: types.
| -rw-r--r-- | src/input-parser.cpp | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/src/input-parser.cpp b/src/input-parser.cpp index 003317f..b5dd55b 100644 --- a/src/input-parser.cpp +++ b/src/input-parser.cpp @@ -41,21 +41,21 @@ std::unique_ptr<InputParser> InputParser::FromDataType(DataType dtype, double prescale, bool is_complex) { if (dtype == DataType::kSignedInt8) { - return std::make_unique<IntegerInputParser<char>>(prescale, is_complex); + return std::make_unique<IntegerInputParser<std::int8_t>>(prescale, is_complex); } else if (dtype == DataType::kSignedInt16) { - return std::make_unique<IntegerInputParser<short>>(prescale, is_complex); + return std::make_unique<IntegerInputParser<std::int16_t>>(prescale, is_complex); } else if (dtype == DataType::kSignedInt32) { - return std::make_unique<IntegerInputParser<int>>(prescale, is_complex); + return std::make_unique<IntegerInputParser<std::int32_t>>(prescale, is_complex); } else if (dtype == DataType::kSignedInt64) { - return std::make_unique<IntegerInputParser<long long>>(prescale, is_complex); + return std::make_unique<IntegerInputParser<std::int64_t>>(prescale, is_complex); } else if (dtype == DataType::kUnsignedInt8) { - return std::make_unique<IntegerInputParser<unsigned char>>(prescale, is_complex); + return std::make_unique<IntegerInputParser<std::uint8_t>>(prescale, is_complex); } else if (dtype == DataType::kUnsignedInt16) { - return std::make_unique<IntegerInputParser<unsigned short>>(prescale, is_complex); + return std::make_unique<IntegerInputParser<std::uint16_t>>(prescale, is_complex); } else if (dtype == DataType::kUnsignedInt32) { - return std::make_unique<IntegerInputParser<unsigned int>>(prescale, is_complex); + return std::make_unique<IntegerInputParser<std::uint32_t>>(prescale, is_complex); } else if (dtype == DataType::kUnsignedInt64) { - return std::make_unique<IntegerInputParser<unsigned long long>>(prescale, is_complex); + return std::make_unique<IntegerInputParser<std::uint64_t>>(prescale, is_complex); } else if (dtype == DataType::kFloat32) { return std::make_unique<FloatInputParser<float>>(prescale, is_complex); } else if (dtype == DataType::kFloat64) { @@ -150,4 +150,17 @@ FloatInputParser<T>::ParseBlock(const std::vector<char> &block) } return count; -}
\ No newline at end of file +} + +template class IntegerInputParser<std::uint8_t>; +template class IntegerInputParser<std::uint16_t>; +template class IntegerInputParser<std::uint32_t>; +template class IntegerInputParser<std::uint64_t>; + +template class IntegerInputParser<std::int8_t>; +template class IntegerInputParser<std::int16_t>; +template class IntegerInputParser<std::int32_t>; +template class IntegerInputParser<std::int64_t>; + +template class FloatInputParser<float>; +template class FloatInputParser<double>; |
