engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 友元 | 所有成员列表
TRangeSet< ElementType > 模板类 参考

Template for range sets. 更多...

#include <RangeSet.h>

Public 成员函数

void Add (RangeType Range)
 Adds a range to the set. 更多...
 
bool Contains (const RangeType &Range) const
 Checks whether this set contains the specified range. 更多...
 
bool Contains (ElementValueOrConstRef Element) const
 Checks whether this set contains the specified element. 更多...
 
void Empty ()
 Removes a range from the set. 更多...
 
BoundsType GetMaxBound () const
 Gets the range set's uppermost bound. 更多...
 
ElementType GetMaxBoundValue () const
 Gets the value of the uppermost bound. 更多...
 
BoundsType GetMinBound () const
 Gets the range set's lowest bound. 更多...
 
ElementType GetMinBoundValue () const
 Gets the value of the lowest bound. 更多...
 
template<typename Allocator >
const void GetRanges (TArray< RangeType, Allocator > &OutRanges) const
 Returns a read-only collection of the ranges contained in this set. 更多...
 
bool HasMaxBound () const
 Checks whether the range has an uppermost bound. 更多...
 
bool HasMinBound () const
 Checks whether the range has a lowest bound. 更多...
 
bool IsEmpty () const
 Checks whether this range set is empty. 更多...
 
void Merge (const TRangeSet &Other)
 Merges another range set into this set. 更多...
 
bool Overlaps (const RangeType &Range) const
 Checks whether this range set overlaps with the specified range. 更多...
 
bool Overlaps (const TRangeSet &Other) const
 Checks whether this range set overlaps with another. 更多...
 
 TRangeSet ()
 Default constructor.
 
 ~TRangeSet ()
 Destructor.
 

友元

class FArchive & operator<< (class FArchive &Ar, TRangeSet &RangeSet)
 Serializes the given range set from or into the specified archive. 更多...
 

详细描述

template<typename ElementType>
class TRangeSet< ElementType >

Template for range sets.

待办事项:
gmp: Implement more efficient storage of range sets

成员函数说明

◆ Add()

template<typename ElementType >
void TRangeSet< ElementType >::Add ( RangeType  Range)
inline

Adds a range to the set.

This method merges overlapping ranges into a single range (i.e. {[1, 5], [4, 6]} becomes [1, 6]). Adjacent ranges (i.e. {[1, 4), [4, 6)} are also merged.

参数
RangeThe range to add.

◆ Contains() [1/2]

template<typename ElementType >
bool TRangeSet< ElementType >::Contains ( const RangeType &  Range) const
inline

Checks whether this set contains the specified range.

参数
RangeThe range to check.
返回
true if the set contains the range, false otherwise.

◆ Contains() [2/2]

template<typename ElementType >
bool TRangeSet< ElementType >::Contains ( ElementValueOrConstRef  Element) const
inline

Checks whether this set contains the specified element.

参数
ElementThe element to check.
返回
true if the element is in the set, false otherwise.

◆ Empty()

template<typename ElementType >
void TRangeSet< ElementType >::Empty ( )
inline

Removes a range from the set.

Ranges that overlap with the removed range will be split.

参数
RangeThe range to remove. Removes all ranges from the set.

◆ GetMaxBound()

template<typename ElementType >
BoundsType TRangeSet< ElementType >::GetMaxBound ( ) const
inline

Gets the range set's uppermost bound.

返回
Uppermost bound.
参见
GetMaxBoundValue, GetMinBound, HasMaxBound

◆ GetMaxBoundValue()

template<typename ElementType >
ElementType TRangeSet< ElementType >::GetMaxBoundValue ( ) const
inline

Gets the value of the uppermost bound.

Use HasMaxBound() to ensure that this range actually has an upper bound.

返回
Bound value.
参见
GetMaxBound, GetMinBoundValue, HasMaxBound

◆ GetMinBound()

template<typename ElementType >
BoundsType TRangeSet< ElementType >::GetMinBound ( ) const
inline

Gets the range set's lowest bound.

返回
Lowest bound.
参见
GetMaxBound, GetMinBoundValue, HasMinBound

◆ GetMinBoundValue()

template<typename ElementType >
ElementType TRangeSet< ElementType >::GetMinBoundValue ( ) const
inline

Gets the value of the lowest bound.

Use HasMinBound() to ensure that this range set actually has a lowest bound.

返回
Bound value.
参见
GetMaxBoundValue, GetMinBound, HasMinBound

◆ GetRanges()

template<typename ElementType >
template<typename Allocator >
const void TRangeSet< ElementType >::GetRanges ( TArray< RangeType, Allocator > &  OutRanges) const
inline

Returns a read-only collection of the ranges contained in this set.

参数
AllocatorThe array allocator to use.
OutRangesWill contain the collection of ranges.

◆ HasMaxBound()

template<typename ElementType >
bool TRangeSet< ElementType >::HasMaxBound ( ) const
inline

Checks whether the range has an uppermost bound.

返回
true if the range has an uppermost bound, false otherwise.
参见
GetUpperBound, GetUpperBoundValue, HasMinBound

◆ HasMinBound()

template<typename ElementType >
bool TRangeSet< ElementType >::HasMinBound ( ) const
inline

Checks whether the range has a lowest bound.

返回
true if the range has a lowest bound, false otherwise.
参见
GetMinBound, GetMinBoundValue, HasMaxBound

◆ IsEmpty()

template<typename ElementType >
bool TRangeSet< ElementType >::IsEmpty ( ) const
inline

Checks whether this range set is empty.

返回
true if the range set is empty, false otherwise.

◆ Merge()

template<typename ElementType >
void TRangeSet< ElementType >::Merge ( const TRangeSet< ElementType > &  Other)
inline

Merges another range set into this set.

参数
OtherThe range set to merge.

◆ Overlaps() [1/2]

template<typename ElementType >
bool TRangeSet< ElementType >::Overlaps ( const RangeType &  Range) const
inline

Checks whether this range set overlaps with the specified range.

参数
RangeThe range to check.
返回
true if this set overlaps with the range, false otherwise.

◆ Overlaps() [2/2]

template<typename ElementType >
bool TRangeSet< ElementType >::Overlaps ( const TRangeSet< ElementType > &  Other) const
inline

Checks whether this range set overlaps with another.

参数
OtherThe other range set.
返回
true if the range sets overlap, false otherwise.
待办事项:
gmp: This could be optimized to O(n*logn) using a line sweep on a pre-sorted array of bounds.

友元及相关函数文档

◆ operator<<

template<typename ElementType >
class FArchive & operator<< ( class FArchive &  Ar,
TRangeSet< ElementType > &  RangeSet 
)
friend

Serializes the given range set from or into the specified archive.

参数
ArThe archive to serialize from or into.
RangeSetThe range set to serialize.
返回
The archive.

该类的文档由以下文件生成: