Platform-independent types. More...
Modules | |
Specializations for numeric_traits | |
The number traits class is specialized for number types defined in this API, such as mi::Uint32 and mi::Float64. | |
Namespaces | |
namespace | mi::base |
Namespace for the Base API. | |
Classes | |
struct | mi::base::numeric_traits_base<T> |
Base class for the helper class to deduce properties of numeric types defined in this API. More... | |
struct | mi::base::numeric_traits<T> |
Helper class to deduce properties of numeric types defined in this API. More... | |
Macros | |
#define | MI_BASE_FMT_MI_SINT64 "lld" |
The printf format specifier for mi::Sint64. More... | |
#define | MI_BASE_FMT_MI_UINT64 "llu" |
The printf format specifier for mi::Uint64. More... | |
#define | MI_BASE_FMT_MI_SIZE "llu" |
The printf format specifier for mi::Size. More... | |
#define | MI_BASE_FMT_MI_DIFFERENCE "lld" |
The printf format specifier for mi::Difference. More... | |
#define | MI_PI 3.14159265358979323846 |
Value of Pi. More... | |
#define | MI_PI_2 1.57079632679489661923 |
Value of Pi / 2. More... | |
#define | MI_PI_4 0.78539816339744830962 |
Value of Pi / 4. More... | |
Typedefs | |
using | mi::Sint8 = signed char |
8-bit signed integer. More... | |
using | mi::Sint16 = short |
16-bit signed integer. More... | |
using | mi::Sint32 = int |
32-bit signed integer. More... | |
using | mi::Uint8 = unsigned char |
8-bit unsigned integer. More... | |
using | mi::Uint16 = unsigned short |
16-bit unsigned integer. More... | |
using | mi::Uint32 = unsigned int |
32-bit unsigned integer. More... | |
using | mi::Float32 = float |
32-bit float. More... | |
using | mi::Float64 = double |
64-bit float. More... | |
using | mi::Sint64 = long long |
64-bit signed integer. More... | |
using | mi::Uint64 = unsigned long long |
64-bit unsigned integer. More... | |
using | mi::Size = Uint64 |
Unsigned integral type that is large enough to hold the size of all types. More... | |
using | mi::Difference = Sint64 |
Signed integral type that is large enough to hold the difference of two pointers. More... | |
Enumerations | |
enum | mi::Comparison_result { mi::NEGATIVE = -1 , mi::ZERO = 0 , mi::POSITIVE = 1 , mi::LESS = -1 , mi::EQUAL = 0 , mi::GREATER = 1 } |
An enum for a three-valued comparison result. More... | |
Functions | |
Comparison_result | mi::operator- (Comparison_result sign) |
Reverses the sign of a three valued enum. More... | |
template<typename T> | |
Comparison_result | mi::three_valued_sign (T t) |
Returns the three valued sign for a numerical type T . More... | |
template<typename T> | |
Comparison_result | mi::three_valued_compare (T lhs, T rhs) |
Returns the three valued comparison result between two values of a numerical type T . More... | |
template<class Target , class Source> | |
Target | mi::base::binary_cast (Source const &val) |
Cast an immutable 'Source' value to an immutable 'Target' value. More... | |
Variables | |
static const Size | mi::SIZE_MAX_VALUE = 18446744073709551615ULL |
The maximum value for Size . More... | |
static const Difference | mi::DIFFERENCE_MIN_VALUE = -9223372036854775807LL - 1LL |
The minimum value for Difference . More... | |
static const Difference | mi::DIFFERENCE_MAX_VALUE = 9223372036854775807LL |
The maximum value for Difference . More... | |
Platform-independent types.
#include <mi/base/types.h>
#define MI_BASE_FMT_MI_DIFFERENCE "lld" |
The printf
format specifier for mi::Difference.
#define MI_BASE_FMT_MI_SINT64 "lld" |
The printf
format specifier for mi::Sint64.
#define MI_BASE_FMT_MI_SIZE "llu" |
#define MI_BASE_FMT_MI_UINT64 "llu" |
The printf
format specifier for mi::Uint64.
#define MI_PI 3.14159265358979323846 |
Value of Pi.
#define MI_PI_2 1.57079632679489661923 |
Value of Pi / 2.
#define MI_PI_4 0.78539816339744830962 |
Value of Pi / 4.
using mi::Difference = typedef Sint64 |
Signed integral type that is large enough to hold the difference of two pointers.
It corresponds to a 32-bit signed integer on 32-bit architectures and a 64-bit signed integer on 64-bit architectures.
using mi::Float32 = typedef float |
32-bit float.
using mi::Float64 = typedef double |
64-bit float.
using mi::Sint16 = typedef short |
16-bit signed integer.
using mi::Sint32 = typedef int |
32-bit signed integer.
using mi::Sint64 = typedef long long |
64-bit signed integer.
using mi::Sint8 = typedef signed char |
8-bit signed integer.
Unsigned integral type that is large enough to hold the size of all types.
This type is for example used for dimensions and indices of vectors.
It corresponds to a 32-bit unsigned integer on 32-bit architectures and a 64-bit unsigned integer on 64-bit architectures.
using mi::Uint16 = typedef unsigned short |
16-bit unsigned integer.
using mi::Uint32 = typedef unsigned int |
32-bit unsigned integer.
using mi::Uint64 = typedef unsigned long long |
64-bit unsigned integer.
using mi::Uint8 = typedef unsigned char |
8-bit unsigned integer.
An enum for a three-valued comparison result.
The three values, -1, 0, and 1, have several symbolic names that can be used interchangeable depending on the context. The symbolic names group together as indicated in their order.
|
inline |
Cast an immutable 'Source' value to an immutable 'Target' value.
Use this function as follows:
|
inline |
Reverses the sign of a three valued enum.
|
inline |
Returns the three valued comparison result between two values of a numerical type T
.
T
must be comparable.lhs
or rhs
is NaN.
|
inline |
Returns the three valued sign for a numerical type T
.
T
must be comparable against 0.t
is NaN.
|
static |
The maximum value for Difference
.
|
static |
The minimum value for Difference
.
|
static |
The maximum value for Size
.