FireSTARR
Loading...
Searching...
No Matches
fs::data::Index< T > Class Template Reference

A wrapper around a MathSize to ensure correct types are used. More...

#include <Index.h>

Inheritance diagram for fs::data::Index< T >:

Public Member Functions

 ~Index ()=default
 Destructor.
 
constexpr Index () noexcept
 Construct with a value of 0.
 
constexpr Index (const MathSize value) noexcept
 Construct with given value.
 
constexpr Index (Index< T > &&rhs) noexcept=default
 Move constructor.
 
constexpr Index (const Index< T > &rhs) noexcept=default
 Copy constructor.
 
Index< T > & operator= (Index< T > &&rhs) noexcept=default
 Move assignment.
 
Index< T > & operator= (const Index< T > &rhs) noexcept=default
 Copy assignment.
 
constexpr bool operator== (const Index< T > &rhs) const noexcept
 Equality operator.
 
constexpr bool operator!= (const Index< T > &rhs) const noexcept
 Not equals operator.
 
constexpr MathSize asValue () const noexcept
 Returns value as a MathSize.
 
constexpr bool operator< (const Index< T > rhs) const noexcept
 Less than operator.
 
constexpr bool operator> (const Index< T > rhs) const noexcept
 Greater than operator.
 
constexpr bool operator<= (const Index< T > rhs) const noexcept
 Less than or equal to operator.
 
constexpr bool operator>= (const Index< T > rhs) const noexcept
 Greater than or equal to operator.
 
constexpr Index< T > operator+ (const Index< T > rhs) const noexcept
 Addition operator.
 
constexpr Index< T > operator- (const Index< T > rhs) const noexcept
 Subtraction operator.
 
constexpr Index< T > & operator+= (const Index< T > rhs) noexcept
 Addition assignment operator.
 
constexpr Index< T > & operator-= (const Index< T > rhs) noexcept
 Subtraction assignment operator.
 

Private Attributes

MathSize value_
 Value represented by this.
 

Detailed Description

template<class T>
class fs::data::Index< T >

A wrapper around a MathSize to ensure correct types are used.

Template Parameters
TThe derived class that this Index represents.

Constructor & Destructor Documentation

◆ Index() [1/3]

template<class T >
fs::data::Index< T >::Index ( const MathSize value)
inlineexplicitconstexprnoexcept

Construct with given value.

Parameters
valueValue to assign

◆ Index() [2/3]

template<class T >
fs::data::Index< T >::Index ( Index< T > && rhs)
constexprdefaultnoexcept

Move constructor.

Parameters
rhsIndex to move from

◆ Index() [3/3]

template<class T >
fs::data::Index< T >::Index ( const Index< T > & rhs)
constexprdefaultnoexcept

Copy constructor.

Parameters
rhsIndex to copy from

Member Function Documentation

◆ asValue()

template<class T >
MathSize fs::data::Index< T >::asValue ( ) const
inlinenodiscardconstexprnoexcept

Returns value as a MathSize.

Returns
MathSize value for Index
Here is the caller graph for this function:

◆ operator!=()

template<class T >
bool fs::data::Index< T >::operator!= ( const Index< T > & rhs) const
inlinenodiscardconstexprnoexcept

Not equals operator.

Parameters
rhsIndex to compare to
Returns
Whether or not these are not equivalent

◆ operator+()

template<class T >
Index< T > fs::data::Index< T >::operator+ ( const Index< T > rhs) const
inlinenodiscardconstexprnoexcept

Addition operator.

Parameters
rhsIndex to add value from
Returns
The value of this plus the value of the provided index
Here is the call graph for this function:

◆ operator+=()

template<class T >
Index< T > & fs::data::Index< T >::operator+= ( const Index< T > rhs)
inlineconstexprnoexcept

Addition assignment operator.

Parameters
rhsIndex to add value from
Returns
This, plus the value of the provided Index

◆ operator-()

template<class T >
Index< T > fs::data::Index< T >::operator- ( const Index< T > rhs) const
inlinenodiscardconstexprnoexcept

Subtraction operator.

Parameters
rhsIndex to add value from
Returns
The value of this minus the value of the provided index
Here is the call graph for this function:

◆ operator-=()

template<class T >
Index< T > & fs::data::Index< T >::operator-= ( const Index< T > rhs)
inlineconstexprnoexcept

Subtraction assignment operator.

Parameters
rhsIndex to add value from
Returns
This, minus the value of the provided Index

◆ operator<()

template<class T >
bool fs::data::Index< T >::operator< ( const Index< T > rhs) const
inlineconstexprnoexcept

Less than operator.

Parameters
rhsIndex to compare to
Returns
Whether or not this is less than the provided Index

◆ operator<=()

template<class T >
bool fs::data::Index< T >::operator<= ( const Index< T > rhs) const
inlinenodiscardconstexprnoexcept

Less than or equal to operator.

Parameters
rhsIndex to compare to
Returns
Whether or not this is less than or equal to the provided Index

◆ operator=() [1/2]

template<class T >
Index< T > & fs::data::Index< T >::operator= ( const Index< T > & rhs)
defaultnoexcept

Copy assignment.

Parameters
rhsIndex to copy from
Returns
This, after assignment

◆ operator=() [2/2]

template<class T >
Index< T > & fs::data::Index< T >::operator= ( Index< T > && rhs)
defaultnoexcept

Move assignment.

Parameters
rhsIndex to move from
Returns
This, after assignment

◆ operator==()

template<class T >
bool fs::data::Index< T >::operator== ( const Index< T > & rhs) const
inlinenodiscardconstexprnoexcept

Equality operator.

Parameters
rhsIndex to compare to
Returns
Whether or not these are equivalent

◆ operator>()

template<class T >
bool fs::data::Index< T >::operator> ( const Index< T > rhs) const
inlinenodiscardconstexprnoexcept

Greater than operator.

Parameters
rhsIndex to compare to
Returns
Whether or not this is greater than the provided Index

◆ operator>=()

template<class T >
bool fs::data::Index< T >::operator>= ( const Index< T > rhs) const
inlinenodiscardconstexprnoexcept

Greater than or equal to operator.

Parameters
rhsIndex to compare to
Returns
Whether or not this is greater than or equal to the provided Index

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