17#ifndef MIR_GEOMETRY_DIMENSIONS_H_
18#define MIR_GEOMETRY_DIMENSIONS_H_
32template<
typename T,
typename Tag>
41 template <
typename Q = T>
42 constexpr typename std::enable_if<std::is_integral<Q>::value,
int>::type
as_int()
const
47 template <
typename Q = T>
48 constexpr typename std::enable_if<std::is_integral<Q>::value, uint32_t>::type
as_uint32_t()
const
77 template<typename U, typename std::enable_if<std::is_scalar<U>::value,
bool>::type =
true>
85 return value == rhs.as_value();
90 return value != rhs.as_value();
95 return value <= rhs.as_value();
100 return value >= rhs.as_value();
105 return value < rhs.as_value();
110 return value > rhs.as_value();
117template<
typename T,
typename Tag>
205template<
typename T,
typename Scalar>
207template<
typename T,
typename Scalar>
209template<
typename T,
typename Scalar>
211template<
typename T,
typename Scalar>
213template<
typename T,
typename Scalar>
215template<
typename T,
typename Scalar>
217template<
typename T,
typename Scalar>
219template<
typename T,
typename Scalar>
223template<
typename T,
typename Scalar>
225template<
typename T,
typename Scalar>
227template<
typename T,
typename Scalar>
229template<
typename T,
typename Scalar>
DeltaX< T > & operator-=(DeltaX< T > &lhs, DeltaX< T > rhs)
Definition dimensions.h:142
std::ostream & operator<<(std::ostream &out, Value< T, Tag > const &value)
Definition dimensions.h:118
constexpr Width< T > operator/(Width< T > const &w, Scalar scale)
Definition dimensions.h:224
constexpr DeltaX< T > operator+(DeltaX< T > lhs, DeltaX< T > rhs)
Definition dimensions.h:126
DeltaX< T > & operator+=(DeltaX< T > &lhs, DeltaX< T > rhs)
Definition dimensions.h:138
constexpr Width< T > operator*(Scalar scale, Width< T > const &w)
Definition dimensions.h:206
constexpr DeltaX< T > operator-(DeltaX< T > lhs, DeltaX< T > rhs)
Definition dimensions.h:130
constexpr generic::DeltaX< T > as_delta(generic::X< T > const &x)
Definition dimensions.h:243
constexpr generic::X< T > as_x(generic::DeltaX< T > const &dx)
Definition dimensions.h:239
constexpr generic::Width< T > as_width(generic::DeltaX< T > const &dx)
Definition dimensions.h:235
constexpr generic::Height< T > as_height(generic::DeltaY< T > const &dy)
Definition dimensions.h:237
constexpr generic::Y< T > as_y(generic::DeltaY< T > const &dy)
Definition dimensions.h:241
Definition splash_session.h:22
Wraps a geometry value and prevents it from being accidentally used for invalid operations (such as s...
Definition dimensions.h:37
constexpr Value(Value const &that) noexcept
Definition dimensions.h:66
constexpr T as_value() const noexcept
Definition dimensions.h:53
constexpr auto operator<(Value< T, Tag > const &rhs) const -> bool
Definition dimensions.h:103
constexpr auto operator>=(Value< T, Tag > const &rhs) const -> bool
Definition dimensions.h:98
constexpr Value() noexcept
Definition dimensions.h:58
constexpr std::enable_if< std::is_integral< Q >::value, uint32_t >::type as_uint32_t() const
Definition dimensions.h:48
constexpr auto operator<=(Value< T, Tag > const &rhs) const -> bool
Definition dimensions.h:93
T ValueType
Definition dimensions.h:38
Value & operator=(Value const &that) noexcept
Definition dimensions.h:60
constexpr Value(Value< U, Tag > const &value) noexcept
Definition dimensions.h:72
constexpr auto operator!=(Value< T, Tag > const &rhs) const -> bool
Definition dimensions.h:88
constexpr auto operator>(Value< T, Tag > const &rhs) const -> bool
Definition dimensions.h:108
constexpr std::enable_if< std::is_integral< Q >::value, int >::type as_int() const
Definition dimensions.h:42
constexpr Value(U const &value) noexcept
Definition dimensions.h:78
constexpr auto operator==(Value< T, Tag > const &rhs) const -> bool
Definition dimensions.h:83
Tag TagType
Definition dimensions.h:39
T value
Definition dimensions.h:114