Vuo
2.3.2
type
VuoIntegerRange.h
Go to the documentation of this file.
1
10
#pragma once
11
12
#include "
VuoInteger.h
"
13
15
#define VuoIntegerRange_NoMinimum INT64_MIN
17
#define VuoIntegerRange_NoMaximum INT64_MAX
18
22
typedef
struct
23
{
24
// The minimum value of a range. (VuoIntegerRange_min >= minimum >= maximum)
25
VuoInteger
minimum;
26
// The maximum value of a range. (minimum >= maximum >= VuoIntegerRange_max)
27
VuoInteger
maximum;
28
}
VuoIntegerRange
;
29
30
VuoIntegerRange
VuoIntegerRange_makeFromJson
(
struct
json_object
* js);
31
struct
json_object
*
VuoIntegerRange_getJson
(
const
VuoIntegerRange
value);
32
char
*
VuoIntegerRange_getSummary
(
const
VuoIntegerRange
value);
33
35
38
VuoIntegerRange
VuoIntegerRange_makeFromString
(
const
char
*str);
39
char
*
VuoIntegerRange_getString
(
const
VuoIntegerRange
value);
40
void
VuoIntegerRange_retain
(
VuoIntegerRange
value);
41
void
VuoIntegerRange_release
(
VuoIntegerRange
value);
43
47
static
inline
VuoIntegerRange
VuoIntegerRange_make
(
VuoInteger
_minimum,
VuoInteger
_maximum) __attribute__((
const
));
48
static
inline
VuoIntegerRange
VuoIntegerRange_make
(
VuoInteger
_minimum,
VuoInteger
_maximum)
49
{
50
return
(
VuoIntegerRange
){_minimum, _maximum};
51
}
52
56
static
inline
bool
VuoIntegerRange_isInverted
(
VuoIntegerRange
range) __attribute__((
const
));
57
static
inline
bool
VuoIntegerRange_isInverted
(
VuoIntegerRange
range)
58
{
59
return
range.minimum > range.maximum;
60
}
61
65
static
inline
VuoIntegerRange
VuoIntegerRange_getOrderedRange
(
VuoIntegerRange
range) __attribute__((
const
));
66
static
inline
VuoIntegerRange
VuoIntegerRange_getOrderedRange
(
VuoIntegerRange
range)
67
{
68
if
(
VuoIntegerRange_isInverted
(range))
69
return
(
VuoIntegerRange
){range.maximum, range.minimum};
70
else
71
return
range;
72
}
Generated on Sat Jun 19 2021 10:17:49 for Vuo by
1.9.1