-
首页
-
C4D R23.110 C++ SDK
#include <rangemap.h>
详细描述
template<typename T, typename MAP = BurstTrieMapSelector<>>
class maxon::RangeSet< T, MAP >
A
RangeSet
allows to add or remove a whole range of values to the set by a single operation (and a single entry in the set). Therefore, it is very useful for, e.g., selection sets where it is likely that contiguous ranges of indices are selected.
RangeSet
is based on
RangeMap
, see there for more details.
RangeSet
supports the usual iterators. They iterate through the map per range (not per each value of a range).
-
Template Parameters
-
T
|
Type of keys. This must be an integral type.
|
MAP
|
A map selector template to choose the underlying map implementation to use. This has to be an ordered map. Note that the default is the
BurstTrieMap
which only allows unsigned integral types.
|
Additional Inherited Members
|
using
|
MapType
= typename
BurstTrieMapSelector
<> ::template Type< T, typename std::conditional<
STD_IS_REPLACEMENT
(same,
UnitType
,
UnitType
),
RangeSetPair
< T >,
Pair
< T,
UnitType
> >::type >
|
using
|
Range
=
maxon::Range
< T >
|
using
|
ValueType
= typename MapType::ValueType
|
using
|
MapValue
= typename MapType::ValueType
|
using
|
Iterator
= typename MapType::template IteratorTemplate< false, EntryIteratorBase >
|
using
|
ConstIterator
= typename MapType::template IteratorTemplate< true, EntryIteratorBase >
|
using
|
KeyIterator
= typename MapType::template IteratorTemplate< false, KeyIteratorBase >
|
using
|
ConstKeyIterator
= typename MapType::template IteratorTemplate< true, KeyIteratorBase >
|
using
|
ValueIterator
= typename MapType::template IteratorTemplate< false, ValueIteratorBase >
|
using
|
ConstValueIterator
= typename MapType::template IteratorTemplate< true, ValueIteratorBase >
|
static
Result
< void >
|
DescribeIO
(const
DataSerializeInterface
&stream)
|
Member Typedef Documentation
◆
Super
◆
Iterator
◆
ConstIterator
构造函数 & 析构函数文档编制
◆
RangeSet()
[1/2]
◆
RangeSet()
[2/2]
成员函数文档编制
◆
GetHashCode()
◆
operator==()
◆
operator!=()
◆
MAXON_OPERATOR_MOVE_ASSIGNMENT()
MAXON_OPERATOR_MOVE_ASSIGNMENT
|
(
|
RangeSet
< T, MAP >
|
|
)
|
|
◆
CopyFrom()
◆
GetMap()
const
Super
& GetMap
|
(
|
|
)
|
const
|
◆
Insert()
[1/3]
Adds the given
value
to this set.
-
参数
-
-
返回
-
False if a memory allocation failed.
◆
Insert()
[2/3]
Adds the range
minValue
...
maxValue
to this set, i.e., all values within that range will be contained in this set afterwards. If
minValue
大于
maxValue
, nothing happens.
-
参数
-
[in]
|
minValue
|
Lower boundary of the range to add.
|
[in]
|
maxValue
|
Upper boundary of the range to add.
|
-
返回
-
False if a memory allocation failed.
◆
Insert()
[3/3]
Adds the given
range
to this set, i.e., all values within that range will be contained in this set afterwards. If the range is empty, nothing happens.
-
参数
-
[in]
|
range
|
The range to add.
|
-
返回
-
False if a memory allocation failed.
◆
Erase()
[1/3]
Removes a single value from this set.
-
参数
-
[in]
|
value
|
Value to remove.
|
-
返回
-
False if a memory allocation failed.
◆
Erase()
[2/3]
Removes the range
minValue
...
maxValue
from this set, i.e., all values within that range won't be contained in this set afterwards. If
minValue
大于
maxValue
, nothing happens.
-
参数
-
[in]
|
minValue
|
Lower boundary of the range to remove.
|
[in]
|
maxValue
|
Upper boundary of the range to remove.
|
-
返回
-
False if a memory allocation failed.
◆
Erase()
[3/3]
Removes the given
range
from this set, i.e., all values within that range won't be contained in this set afterwards. If the range is empty, nothing happens.
-
参数
-
[in]
|
range
|
The range to remove.
|
-
返回
-
False if a memory allocation failed.
◆
Contains()
[1/3]
Bool
Contains
|
(
|
T
|
value
|
)
|
const
|
Checks if this set contains
value
.
-
参数
-
[in]
|
value
|
The value to check.
|
-
返回
-
True if this set contains
value
.
◆
Contains()
[2/3]
Bool
Contains
|
(
|
T
|
minValue
,
|
|
|
T
|
maxValue
|
|
)
|
|
|
Checks if this set contains all values of the range
minValue
...
maxValue
.
-
参数
-
[in]
|
minValue
|
Lower boundary of the range to remove.
|
[in]
|
maxValue
|
Upper boundary of the range to remove.
|
-
返回
-
True if this set contains all values of
minValue
...
maxValue
.
◆
Contains()
[3/3]
Checks if this set contains all values of the given
range
, i.e., if
range
is a subset of this set.
-
参数
-
[in]
|
range
|
The range to check.
|
-
返回
-
True if this set contains all values of
range
.
◆
FindRange()
Finds the contiguous range of values of this set which contains
value
. If such a range exists,
rangeOut
is set to the range and
true
is returned, otherwise
false
is returned.
-
参数
-
[in]
|
value
|
The value to check.
|
[out]
|
rangeOut
|
If a range containing
value
is found,
rangeOut
is set to this range.
|
-
返回
-
True if a range could be found.
◆
Begin()
[1/2]
◆
End()
[1/2]
◆
Begin()
[2/2]
◆
End()
[2/2]
◆
MAXON_DISALLOW_COPY_AND_ASSIGN()
MAXON_DISALLOW_COPY_AND_ASSIGN
|
(
|
RangeSet
< T, MAP >
|
|
)
|
|
|
private
|
◆
Reset()
Resets the map. This removes all entries and frees any memory held by the map, so the map will be in a state as if it had been newly constructed.
-
另请参阅
-
Flush()
◆
Flush()
Flushes the map. This removes all entries. Depending on the underlying map, memory may still be held for later re-use.
-
另请参阅
-
Reset()
◆
IsEmpty()
Checks if the
RangeMap
is empty. This is the same as
GetCount() == 0
-
返回
-
True if this
RangeMap
does not contain any elements.
◆
IsPopulated()
Checks if the
RangeMap
is populated. This is the same as
GetCount() != 0
-
返回
-
True if this
RangeMap
contains any elements.
◆
GetCount()
Returns the number of entries in this map. Each contiguous key range where the keys are mapped to the same value requires a single entry.
-
返回
-
Number of entries.
◆
GetMemorySize()
Calculates the memory usage for this map. Keys and Values must have a public member GetMemorySize that return the element size.
-
返回
-
Memory size in bytes.
◆
ToString()
◆
DescribeIO()
static
Result
<void> DescribeIO
static
|
|