Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
TInterval< ElementType > Struct Template Reference

#include <Interval.h>

Public Member Functions

 TInterval ()
 
 TInterval (ElementType InMin, ElementType InMax)
 
void operator+= (ElementType X)
 
void operator-= (ElementType X)
 
ElementType Size () const
 
bool IsValid () const
 
bool Contains (const ElementType &Element) const
 
void Expand (ElementType ExpandAmount)
 
void Include (ElementType X)
 
ElementType Interpolate (float Alpha) const
 

Public Attributes

ElementType Min
 
ElementType Max
 

Friends

TInterval Intersect (const TInterval &A, const TInterval &B)
 
class FArchiveoperator<< (class FArchive &Ar, TInterval &Interval)
 
uint32 GetTypeHash (const TInterval &Interval)
 

Detailed Description

template<typename ElementType>
struct TInterval< ElementType >

Template for numeric interval

Definition at line 32 of file Interval.h.

Constructor & Destructor Documentation

◆ TInterval() [1/2]

template<typename ElementType >
TInterval< ElementType >::TInterval ( )
inline

Default constructor.

The interval is invalid

Definition at line 47 of file Interval.h.

◆ TInterval() [2/2]

template<typename ElementType >
TInterval< ElementType >::TInterval ( ElementType InMin,
ElementType InMax )
inline

Creates and initializes a new interval with the specified lower and upper bounds.

Parameters
InMinThe lower bound of the constructed interval.
InMaxThe upper bound of the constructed interval.

Definition at line 58 of file Interval.h.

Member Function Documentation

◆ Contains()

template<typename ElementType >
bool TInterval< ElementType >::Contains ( const ElementType & Element) const
inline

Checks whether this interval contains the specified element.

Parameters
ElementThe element to check.
Returns
true if the range interval the element, false otherwise.

Definition at line 121 of file Interval.h.

◆ Expand()

template<typename ElementType >
void TInterval< ElementType >::Expand ( ElementType ExpandAmount)
inline

Expands this interval to both sides by the specified amount.

Parameters
ExpandAmountThe amount to expand by.

Definition at line 131 of file Interval.h.

◆ Include()

template<typename ElementType >
void TInterval< ElementType >::Include ( ElementType X)
inline

Expands this interval if necessary to include the specified element.

Parameters
XThe element to include.

Definition at line 145 of file Interval.h.

◆ Interpolate()

template<typename ElementType >
ElementType TInterval< ElementType >::Interpolate ( float Alpha) const
inline

Interval interpolation

Parameters
Alphainterpolation amount
Returns
interpolation result

Definition at line 172 of file Interval.h.

◆ IsValid()

template<typename ElementType >
bool TInterval< ElementType >::IsValid ( ) const
inline

Whether interval is valid (Min <= Max).

Returns
false when interval is invalid, true otherwise

Definition at line 110 of file Interval.h.

◆ operator+=()

template<typename ElementType >
void TInterval< ElementType >::operator+= ( ElementType X)
inline

Offset the interval by adding X.

Parameters
XThe offset.

Definition at line 70 of file Interval.h.

◆ operator-=()

template<typename ElementType >
void TInterval< ElementType >::operator-= ( ElementType X)
inline

Offset the interval by subtracting X.

Parameters
XThe offset.

Definition at line 84 of file Interval.h.

◆ Size()

template<typename ElementType >
ElementType TInterval< ElementType >::Size ( ) const
inline

Computes the size of this interval.

Returns
Interval size.

Definition at line 100 of file Interval.h.

Friends And Related Symbol Documentation

◆ GetTypeHash

template<typename ElementType >
uint32 GetTypeHash ( const TInterval< ElementType > & Interval)
friend

Gets the hash for the specified interval.

Parameters
IntervalThe Interval to get the hash for.
Returns
Hash value.

Definition at line 219 of file Interval.h.

◆ Intersect

template<typename ElementType >
TInterval Intersect ( const TInterval< ElementType > & A,
const TInterval< ElementType > & B )
friend

Calculates the intersection of two intervals.

Parameters
AThe first interval.
BThe second interval.
Returns
The intersection.

Definition at line 191 of file Interval.h.

◆ operator<<

template<typename ElementType >
class FArchive & operator<< ( class FArchive & Ar,
TInterval< ElementType > & Interval )
friend

Serializes the interval.

Parameters
ArThe archive to serialize into.
IntervalThe interval to serialize.
Returns
Reference to the Archive after serialization.

Definition at line 208 of file Interval.h.

Member Data Documentation

◆ Max

template<typename ElementType >
ElementType TInterval< ElementType >::Max

Holds the upper bound of the interval.

Definition at line 38 of file Interval.h.

◆ Min

template<typename ElementType >
ElementType TInterval< ElementType >::Min

Holds the lower bound of the interval.

Definition at line 35 of file Interval.h.


The documentation for this struct was generated from the following file: