|
STIR 6.4.0
|
provides names for some numeric types and methods for finding their properties. More...
#include "stir/NumericType.h"
Public Types | |
| enum | Type { BIT , SCHAR , UCHAR , SHORT , USHORT , INT , UINT , LONG , ULONG , FLOAT , DOUBLE , UNKNOWN_TYPE } |
| An enum for the supported types. | |
Public Member Functions | |
| NumericType (Type t=UNKNOWN_TYPE) | |
| constructor, defaulting to unknown type | |
| NumericType (const std::string &number_format, const std::size_t size_in_bytes) | |
| A constructor to work from named types a la Interfile. | |
| bool | operator== (NumericType type) const |
| comparison operator | |
| bool | operator!= (NumericType type) const |
| std::size_t | size_in_bytes () const |
| as reported by sizeof(), so it is really size_in_sizeof_char | |
| std::size_t | size_in_bits () const |
| bool | signed_type () const |
returns true for all built-in types, except unsigned types | |
| bool | integer_type () const |
returns true for all built-in types, except float and double | |
| 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) | |
Public Attributes | |
| Type | id |
| stores the current type | |
provides names for some numeric types and methods for finding their properties.
| stir::NumericType::NumericType | ( | const std::string & | number_format, |
| const std::size_t | size_in_bytes ) |
A constructor to work from named types a la Interfile.
Possible values for number_format are bit, signed integer, unsigned integer, float Exact types are determined via the size_in_bytes parameter.
References get_Interfile_info(), integer_type(), NumericType(), operator==(), signed_type(), and size_in_bytes().