CatapultServer  v0.5.0.1 (Elephant)
catapult::utils::ClampedBaseValue< TValue, TRange > Struct Template Reference

Base values that are constrained to a range of values. More...

Inheritance diagram for catapult::utils::ClampedBaseValue< TValue, TRange >:
Collaboration diagram for catapult::utils::ClampedBaseValue< TValue, TRange >:

Public Types

using Unclamped = typename Traits::UnclampedType
 Compatible unclamped type. More...
 
- Public Types inherited from catapult::utils::BasicBaseValue< TValue, TTag, TBaseValue >
using ValueType = TValue
 Raw value type. More...
 

Public Member Functions

constexpr ClampedBaseValue (TValue value=TRange::Default_Value)
 Creates a clamped base value from a raw value. More...
 
constexpr ClampedBaseValue operator+ (Unclamped rhs) const
 Adds rhs and this value and returns a new value. More...
 
constexpr Unclamped operator- (ClampedBaseValue rhs) const
 Subtracts rhs from this value and returns a new value. More...
 
- Public Member Functions inherited from catapult::utils::BasicBaseValue< TValue, TTag, TBaseValue >
constexpr BasicBaseValue (TValue value)
 Creates a basic base value from a raw value. More...
 
constexpr BasicBaseValue (const BasicBaseValue &rhs)
 Creates a copy of rhs. More...
 
BasicBaseValueoperator= (BasicBaseValue rhs)
 Assigns rhs to this. More...
 
constexpr ValueType unwrap () const
 Unwraps this value and returns the underlying raw value. More...
 
constexpr bool operator== (TBaseValue rhs) const
 Returns true if this value is equal to rhs. More...
 
constexpr bool operator!= (TBaseValue rhs) const
 Returns true if this value is not equal to rhs. More...
 
constexpr bool operator>= (TBaseValue rhs) const
 Returns true if this value is greater than or equal to rhs. More...
 
constexpr bool operator> (TBaseValue rhs) const
 Returns true if this value is greater than rhs. More...
 
constexpr bool operator<= (TBaseValue rhs) const
 Returns true if this value is less than or equal to rhs. More...
 
constexpr bool operator< (TBaseValue rhs) const
 Returns true if this value is less than rhs. More...
 

Static Public Member Functions

static constexpr ClampedBaseValue Min ()
 
static constexpr ClampedBaseValue Max ()
 

Private Types

using Traits = detail::ClampedBaseValueTraits< TValue, TRange >
 

Static Private Member Functions

static constexpr TValue Clamp (TValue value)
 

Detailed Description

template<typename TValue, typename TRange>
struct catapult::utils::ClampedBaseValue< TValue, TRange >

Base values that are constrained to a range of values.

Member Typedef Documentation

◆ Traits

template<typename TValue, typename TRange>
using catapult::utils::ClampedBaseValue< TValue, TRange >::Traits = detail::ClampedBaseValueTraits<TValue, TRange>
private

◆ Unclamped

template<typename TValue, typename TRange>
using catapult::utils::ClampedBaseValue< TValue, TRange >::Unclamped = typename Traits::UnclampedType

Compatible unclamped type.

Constructor & Destructor Documentation

◆ ClampedBaseValue()

template<typename TValue, typename TRange>
constexpr catapult::utils::ClampedBaseValue< TValue, TRange >::ClampedBaseValue ( TValue  value = TRange::Default_Value)
inlineexplicitconstexpr

Creates a clamped base value from a raw value.

Here is the caller graph for this function:

Member Function Documentation

◆ Clamp()

template<typename TValue, typename TRange>
static constexpr TValue catapult::utils::ClampedBaseValue< TValue, TRange >::Clamp ( TValue  value)
inlinestaticconstexprprivate

◆ Max()

template<typename TValue, typename TRange>
static constexpr ClampedBaseValue catapult::utils::ClampedBaseValue< TValue, TRange >::Max ( )
inlinestaticconstexpr

Gets the maximum clamped value.

Note
Function because ClampedBaseValue is incomplete (until closing brace).

◆ Min()

template<typename TValue, typename TRange>
static constexpr ClampedBaseValue catapult::utils::ClampedBaseValue< TValue, TRange >::Min ( )
inlinestaticconstexpr

Gets the minimum clamped value.

Note
Function because ClampedBaseValue is incomplete (until closing brace).

◆ operator+()

template<typename TValue, typename TRange>
constexpr ClampedBaseValue catapult::utils::ClampedBaseValue< TValue, TRange >::operator+ ( Unclamped  rhs) const
inlineconstexpr

Adds rhs and this value and returns a new value.

◆ operator-()

template<typename TValue, typename TRange>
constexpr Unclamped catapult::utils::ClampedBaseValue< TValue, TRange >::operator- ( ClampedBaseValue< TValue, TRange >  rhs) const
inlineconstexpr

Subtracts rhs from this value and returns a new value.


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