CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
24 namespace catapult {
namespace utils {
26 template<
typename TValue,
typename TRange>
32 template<
typename TRange>
36 template<
typename TValue,
typename TRange>
49 template<
typename TValue,
typename TRange>
65 static constexpr TValue
Clamp(TValue value) {
66 return value < TRange::Min_Value
68 : value > TRange::Max_Value ? TRange::Max_Value : value;
Definition: ClampedBaseValue.h:33
constexpr ClampedBaseValue(TValue value=TRange::Default_Value)
Creates a clamped base value from a raw value.
Definition: ClampedBaseValue.h:60
static constexpr TValue Clamp(TValue value)
Definition: ClampedBaseValue.h:65
constexpr ValueType unwrap() const
Unwraps this value and returns the underlying raw value.
Definition: BaseValue.h:53
constexpr ClampedBaseValue operator+(Unclamped rhs) const
Adds rhs and this value and returns a new value.
Definition: ClampedBaseValue.h:86
BaseValue< TValue, TaggedRangeType > UnclampedType
Definition: ClampedBaseValue.h:40
Immutable wrapper for basic types, to provide some type-safety.
Definition: BaseValue.h:100
Base class for immutable wrappers of basic types, to provide some type-safety.
Definition: BaseValue.h:30
static constexpr ClampedBaseValue Max()
Definition: ClampedBaseValue.h:80
typename Traits::UnclampedType Unclamped
Compatible unclamped type.
Definition: ClampedBaseValue.h:56
Defines types used in the definition of ClampedBaseValue.
Definition: ClampedBaseValue.h:37
Definition: AddressExtractionExtension.cpp:28
Base values that are constrained to a range of values.
Definition: ClampedBaseValue.h:27
constexpr Unclamped operator-(ClampedBaseValue rhs) const
Subtracts rhs from this value and returns a new value.
Definition: ClampedBaseValue.h:91
static constexpr ClampedBaseValue Min()
Definition: ClampedBaseValue.h:74