10 size_t nFractionalDigits_,
DataType rawDataType_,
DataType transportLayerDataType_)
11 : _fundamentalType(fundamentalType_), _rawDataType(rawDataType_), _transportLayerDataType(transportLayerDataType_),
12 _isIntegral(isIntegral_), _isSigned(isSigned_), _nDigits(nDigits_), _nFractionalDigits(nFractionalDigits_) {}
28 _nFractionalDigits = 0;
56 _nFractionalDigits = 45;
60 _nFractionalDigits = 325;
73 : _fundamentalType(
FundamentalType::undefined), _isIntegral(false), _isSigned(false), _nDigits(0),
74 _nFractionalDigits(0) {}
79 return _fundamentalType;
107 return _nFractionalDigits;
123 return _transportLayerDataType;
129 return _fundamentalType == other._fundamentalType && _rawDataType == other._rawDataType &&
130 _transportLayerDataType == other._transportLayerDataType && _isIntegral == other._isIntegral &&
131 _isSigned == other._isSigned && _nDigits == other._nDigits && _nFractionalDigits == other._nFractionalDigits;
147 return typeid(int64_t);
150 return typeid(int32_t);
153 return typeid(int16_t);
155 return typeid(int8_t);
158 return typeid(uint64_t);
161 return typeid(uint32_t);
164 return typeid(uint16_t);
166 return typeid(uint8_t);
172 size_t floatMaxDigits = 4 +
174 std::log10(std::numeric_limits<float>::max()), -std::log10(std::numeric_limits<float>::denorm_min())));
175 if(
nDigits() > floatMaxDigits) {
176 return typeid(double);
178 return typeid(float);
184 return typeid(std::string);
209 stream <<
"undefined";
Wrapper Class to avoid vector<bool> problems.
Class describing the actual payload data format of a register in an abstract manner.
size_t nFractionalDigits() const
Approximate maximum number of digits after decimal dot (of base 10) needed to represent the value (ex...
FundamentalType fundamentalType() const
Get the fundamental data type.
bool isIntegral() const
Return whether the data is integral or not (e.g.
DataType transportLayerDataType() const
Get the data type on the transport layer.
DataDescriptor()
Default constructor sets fundamental type to "undefined".
DataType minimumDataType() const
Get the minimum data type required to represent the described data type in the host CPU.
void setRawDataType(const DataType &d)
Set the raw data type.
bool operator!=(const DataDescriptor &other) const
bool operator==(const DataDescriptor &other) const
size_t nDigits() const
Return the approximate maximum number of digits (of base 10) needed to represent the value (including...
DataType rawDataType() const
Get the raw data type.
bool isSigned() const
Return whether the data is signed or not.
FundamentalType
Enum for the fundamental data types.
A class to describe which of the supported data types is used.
@ uint32
Unsigned 32 bit integer.
@ int16
Signed 16 bit integer.
@ int32
Signed 32 bit integer.
@ int64
Signed 64 bit integer.
@ float32
Single precision float.
@ uint16
Unsigned 16 bit integer.
@ uint64
Unsigned 64 bit integer.
@ uint8
Unsigned 8 bit integer.
@ float64
Double precision float.
@ int8
Signed 8 bit integer.
bool isNumeric() const
Returns whether the data type is numeric.
bool isIntegral() const
Return whether the raw data type is an integer.
bool isSigned() const
Return whether the raw data type is signed.
std::ostream & operator<<(std::ostream &stream, const DataDescriptor::FundamentalType &fundamentalType)