11#ifndef __stir_NumericType_H__
12#define __stir_NumericType_H__
98 std::size_t size_in_bits()
const;
120template <
int numeric_type_enum>
129 typedef signed char type;
132struct TypeForNumericType<NumericType::UCHAR>
134 typedef unsigned char type;
137struct TypeForNumericType<NumericType::SHORT>
139 typedef signed short type;
142struct TypeForNumericType<NumericType::USHORT>
144 typedef unsigned short type;
147struct TypeForNumericType<NumericType::INT>
149 typedef signed int type;
152struct TypeForNumericType<NumericType::UINT>
154 typedef unsigned int type;
157struct TypeForNumericType<NumericType::LONG>
159 typedef signed long type;
162struct TypeForNumericType<NumericType::ULONG>
164 typedef unsigned long type;
167struct TypeForNumericType<NumericType::FLOAT>
172struct TypeForNumericType<NumericType::DOUBLE>
Implementation of inline methods of class stir::NumericType.
provides names for some numeric types and methods for finding their properties.
Definition NumericType.h:55
std::size_t size_in_bytes() const
as reported by sizeof(), so it is really size_in_sizeof_char
Definition NumericType.cxx:113
bool operator==(NumericType type) const
comparison operator
Definition NumericType.inl:30
Type
An enum for the supported types.
Definition NumericType.h:62
bool integer_type() const
returns true for all built-in types, except float and double
Definition NumericType.cxx:181
NumericType(Type t=UNKNOWN_TYPE)
constructor, defaulting to unknown type
Definition NumericType.inl:25
bool signed_type() const
returns true for all built-in types, except unsigned types
Definition NumericType.cxx:151
void get_Interfile_info(std::string &number_format, std::size_t &size_in_bytes) const
returns the names and size a la Interfile. see NumericType(const string&,const std::size_t)
Definition NumericType.cxx:81
NumericType(const std::string &number_format, const std::size_t size_in_bytes)
A constructor to work from named types a la Interfile.
Type id
stores the current type
Definition NumericType.h:78
basic configuration include file
A helper class that specifies the C++ type for a particular NumericType.
Definition NumericType.h:122