wuzp
Wrong Unit? Zero Points! Compile-time checks for units, coordinate systems and points vs. vectors.
Loading...
Searching...
No Matches
Unit.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <boost/units/dimensionless_type.hpp>
4#include <boost/units/operators.hpp>
5#include <boost/units/static_rational.hpp>
6#include <boost/units/systems/si.hpp>
7#include <boost/units/unit.hpp>
8
9#include "wuzp/core/Unit.hpp"
10#include "wuzp/core/traits.hpp"
11
33
34namespace wuzp {
35
36template <typename ImplementationLhsT_, typename ImplementationRhsT_>
37struct Product<Unit<ImplementationLhsT_>, Unit<ImplementationRhsT_>> {
39};
40
41template <typename ImplementationLhsT_, typename ImplementationRhsT_>
42struct Division<Unit<ImplementationLhsT_>, Unit<ImplementationRhsT_>> {
44};
45
46template <typename ImplementationT_, typename ExponentT_>
47struct Power<Unit<ImplementationT_>, ExponentT_> {
48 using type =
49 Unit<typename boost::units::power_typeof_helper<ImplementationT_,
50 boost::units::static_rational<ExponentT_::Dividend, ExponentT_::Divisor>>::type>;
51};
52
53template <typename DimensionT_, typename SystemT_>
54struct Identity<Unit<boost::units::unit<DimensionT_, SystemT_>>> {
56};
57
58template <typename ImplementationT_>
59struct Inverse<Unit<ImplementationT_>> {
60 using type = Unit<typename boost::units::power_typeof_helper<ImplementationT_, boost::units::static_rational<-1>>::type>;
61};
62
63template <typename ValueT_>
64struct AccessUnits<AccessImplementation<ValueT_>> {
80};
81
82} // namespace wuzp
wuzp::Unit< boost::units::si::area > Area
Definition Unit.hpp:20
wuzp::Unit< boost::units::si::force > Force
Definition Unit.hpp:23
wuzp::Unit< boost::units::si::energy > Torque
Definition Unit.hpp:24
wuzp::Unit< boost::units::si::frequency > AngularVelocity
Definition Unit.hpp:19
wuzp::Unit< boost::units::si::dimensionless > Angle
Definition Unit.hpp:17
wuzp::Unit< boost::units::si::dimensionless > Dimensionless
Definition Unit.hpp:21
wuzp::Unit< boost::units::si::mass > Mass
Definition Unit.hpp:27
wuzp::Unit< boost::units::si::energy > Energy
Definition Unit.hpp:22
wuzp::Unit< boost::units::si::acceleration > Acceleration
Definition Unit.hpp:16
wuzp::Unit< boost::units::si::frequency > Frequency
Definition Unit.hpp:25
wuzp::Unit< boost::units::si::time > Time
Definition Unit.hpp:28
wuzp::Unit< boost::units::divide_typeof_helper< boost::units::si::frequency, boost::units::si::time >::type > AngularAcceleration
Definition Unit.hpp:18
wuzp::Unit< boost::units::si::length > Length
Definition Unit.hpp:26
wuzp::Unit< boost::units::si::volume > Volume
Definition Unit.hpp:30
wuzp::Unit< boost::units::si::velocity > Velocity
Definition Unit.hpp:29
Type wrapper which is used to access traits partially specialized in the implementation header files.
Definition helpers.hpp:114
wuzp_units::AngularAcceleration AngularAcceleration
Definition Unit.hpp:70
wuzp_units::AngularVelocity AngularVelocity
Definition Unit.hpp:71
The units for values of the arithmetic type ValueT_, e.g. double, specialized for AccessImplementatio...
Definition traits.hpp:338
Unit< typename boost::units::divide_typeof_helper< ImplementationLhsT_, ImplementationRhsT_ >::type > type
Definition Unit.hpp:43
Unit< boost::units::unit< boost::units::dimensionless_type, SystemT_ > > type
Definition Unit.hpp:55
Unit< typename boost::units::power_typeof_helper< ImplementationT_, boost::units::static_rational<-1 > >::type > type
Definition Unit.hpp:60
The inverse: the matrix inverse of a matrix, like Eigen's MatrixBase::inverse(), and the reciprocal o...
Definition traits.hpp:188
Unit< typename boost::units::power_typeof_helper< ImplementationT_, boost::units::static_rational< ExponentT_::Dividend, ExponentT_::Divisor > >::type > type
Definition Unit.hpp:48
Unit< typename boost::units::multiply_typeof_helper< ImplementationLhsT_, ImplementationRhsT_ >::type > type
Definition Unit.hpp:38