|
STIR 6.5.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.
|
inline |
constructor, defaulting to unknown type
References id, and NumericType().
Referenced by NumericType(), NumericType(), operator==(), and stir::InterfileHeader::post_processing().
| 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().
|
inline |
| size_t stir::NumericType::size_in_bytes | ( | ) | const |
as reported by sizeof(), so it is really size_in_sizeof_char
References size_in_bytes().
Referenced by get_Interfile_info(), NumericType(), size_in_bytes(), and stir::write_basic_interfile_image_header().
| bool stir::NumericType::signed_type | ( | ) | const |
returns true for all built-in types, except unsigned types
References signed_type().
Referenced by NumericType(), signed_type(), and stir::write_basic_interfile_image_header().
| bool stir::NumericType::integer_type | ( | ) | const |
returns true for all built-in types, except float and double
References integer_type().
Referenced by integer_type(), NumericType(), and stir::write_basic_interfile_image_header().
| void stir::NumericType::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)
References get_Interfile_info(), and size_in_bytes().
Referenced by get_Interfile_info(), NumericType(), and stir::write_basic_interfile_PDFS_header().
| Type stir::NumericType::id |
stores the current type
Referenced by stir::ecat::ecat7::make_ECAT7_main_header(), and NumericType().