kblib 0.2.3
General utilities library for modern C++
kblib::detail_units Namespace Reference

Classes

struct  is_si_ratio
 
struct  is_si_ratio< std::atto >
 
struct  is_si_ratio< std::centi >
 
struct  is_si_ratio< std::deca >
 
struct  is_si_ratio< std::deci >
 
struct  is_si_ratio< std::exa >
 
struct  is_si_ratio< std::femto >
 
struct  is_si_ratio< std::giga >
 
struct  is_si_ratio< std::hecto >
 
struct  is_si_ratio< std::kilo >
 
struct  is_si_ratio< std::mega >
 
struct  is_si_ratio< std::micro >
 
struct  is_si_ratio< std::milli >
 
struct  is_si_ratio< std::nano >
 
struct  is_si_ratio< std::peta >
 
struct  is_si_ratio< std::pico >
 
struct  is_si_ratio< std::ratio< 1 > >
 
struct  is_si_ratio< std::tera >
 
struct  nearest_ratio
 
struct  prefix
 
struct  unit_conversion
 

Typedefs

template<std::intmax_t Num, std::intmax_t Den>
using nearest_ratio_t = typename nearest_ratio< Num, Den >::type
 

Functions

constexpr auto unit_of (std::chrono::nanoseconds) noexcept -> auto
 
constexpr auto unit_of (std::chrono::microseconds) noexcept -> auto
 
constexpr auto unit_of (std::chrono::milliseconds) noexcept -> auto
 
constexpr auto unit_of (std::chrono::seconds) noexcept -> auto
 
constexpr auto unit_of (std::chrono::minutes) noexcept -> auto
 
constexpr auto unit_of (std::chrono::hours) noexcept -> auto
 
constexpr auto name_of (std::atto) -> prefix
 
constexpr auto name_of (std::femto) -> prefix
 
constexpr auto name_of (std::pico) -> prefix
 
constexpr auto name_of (std::nano) -> prefix
 
constexpr auto name_of (std::micro) -> prefix
 
constexpr auto name_of (std::milli) -> prefix
 
constexpr auto name_of (std::centi) -> prefix
 
constexpr auto name_of (std::deci) -> prefix
 
constexpr auto name_of (std::ratio< 1, 1 >) -> prefix
 
constexpr auto name_of (std::deca) -> prefix
 
constexpr auto name_of (std::hecto) -> prefix
 
constexpr auto name_of (std::kilo) -> prefix
 
constexpr auto name_of (std::mega) -> prefix
 
constexpr auto name_of (std::giga) -> prefix
 
constexpr auto name_of (std::tera) -> prefix
 
constexpr auto name_of (std::peta) -> prefix
 
constexpr auto name_of (std::exa) -> prefix
 
constexpr auto largest_power_1000 (std::intmax_t in) -> int
 
constexpr auto largest_power_1000_p (double in) -> int
 
constexpr auto largest_power_1000 (double in) -> int
 
constexpr auto pow1000 (int p) -> double
 
template<std::intmax_t Num, std::intmax_t Den>
auto ratio_to_SI () noexcept -> unit_conversion< std::intmax_t >
 

Typedef Documentation

◆ nearest_ratio_t

template<std::intmax_t Num, std::intmax_t Den>
using kblib::detail_units::nearest_ratio_t = typedef typename nearest_ratio<Num, Den>::type

Definition at line 459 of file convert.h.

Function Documentation

◆ largest_power_1000() [1/2]

constexpr auto kblib::detail_units::largest_power_1000 ( double  in) -> int
constexpr

Definition at line 361 of file convert.h.

◆ largest_power_1000() [2/2]

constexpr auto kblib::detail_units::largest_power_1000 ( std::intmax_t  in) -> int
constexpr

Definition at line 346 of file convert.h.

◆ largest_power_1000_p()

constexpr auto kblib::detail_units::largest_power_1000_p ( double  in) -> int
constexpr

Definition at line 354 of file convert.h.

◆ name_of() [1/17]

constexpr auto kblib::detail_units::name_of ( std::atto  ) -> prefix
constexpr

Definition at line 319 of file convert.h.

◆ name_of() [2/17]

constexpr auto kblib::detail_units::name_of ( std::centi  ) -> prefix
constexpr

Definition at line 325 of file convert.h.

◆ name_of() [3/17]

constexpr auto kblib::detail_units::name_of ( std::deca  ) -> prefix
constexpr

Definition at line 330 of file convert.h.

◆ name_of() [4/17]

constexpr auto kblib::detail_units::name_of ( std::deci  ) -> prefix
constexpr

Definition at line 326 of file convert.h.

◆ name_of() [5/17]

constexpr auto kblib::detail_units::name_of ( std::exa  ) -> prefix
constexpr

Definition at line 337 of file convert.h.

◆ name_of() [6/17]

constexpr auto kblib::detail_units::name_of ( std::femto  ) -> prefix
constexpr

Definition at line 320 of file convert.h.

◆ name_of() [7/17]

constexpr auto kblib::detail_units::name_of ( std::giga  ) -> prefix
constexpr

Definition at line 334 of file convert.h.

◆ name_of() [8/17]

constexpr auto kblib::detail_units::name_of ( std::hecto  ) -> prefix
constexpr

Definition at line 331 of file convert.h.

◆ name_of() [9/17]

constexpr auto kblib::detail_units::name_of ( std::kilo  ) -> prefix
constexpr

Definition at line 332 of file convert.h.

◆ name_of() [10/17]

constexpr auto kblib::detail_units::name_of ( std::mega  ) -> prefix
constexpr

Definition at line 333 of file convert.h.

◆ name_of() [11/17]

constexpr auto kblib::detail_units::name_of ( std::micro  ) -> prefix
constexpr

Definition at line 323 of file convert.h.

◆ name_of() [12/17]

constexpr auto kblib::detail_units::name_of ( std::milli  ) -> prefix
constexpr

Definition at line 324 of file convert.h.

◆ name_of() [13/17]

constexpr auto kblib::detail_units::name_of ( std::nano  ) -> prefix
constexpr

Definition at line 322 of file convert.h.

◆ name_of() [14/17]

constexpr auto kblib::detail_units::name_of ( std::peta  ) -> prefix
constexpr

Definition at line 336 of file convert.h.

◆ name_of() [15/17]

constexpr auto kblib::detail_units::name_of ( std::pico  ) -> prefix
constexpr

Definition at line 321 of file convert.h.

◆ name_of() [16/17]

constexpr auto kblib::detail_units::name_of ( std::ratio< 1, 1 >  ) -> prefix
constexpr

Definition at line 328 of file convert.h.

◆ name_of() [17/17]

constexpr auto kblib::detail_units::name_of ( std::tera  ) -> prefix
constexpr

Definition at line 335 of file convert.h.

◆ pow1000()

constexpr auto kblib::detail_units::pow1000 ( int  p) -> double
constexpr

Definition at line 372 of file convert.h.

◆ ratio_to_SI()

template<std::intmax_t Num, std::intmax_t Den>
auto kblib::detail_units::ratio_to_SI ( ) -> unit_conversion<std::intmax_t>
noexcept

Definition at line 451 of file convert.h.

◆ unit_of() [1/6]

constexpr auto kblib::detail_units::unit_of ( std::chrono::hours  ) -> auto
constexprnoexcept

Definition at line 286 of file convert.h.

◆ unit_of() [2/6]

constexpr auto kblib::detail_units::unit_of ( std::chrono::microseconds  ) -> auto
constexprnoexcept

Definition at line 269 of file convert.h.

◆ unit_of() [3/6]

constexpr auto kblib::detail_units::unit_of ( std::chrono::milliseconds  ) -> auto
constexprnoexcept

Definition at line 273 of file convert.h.

◆ unit_of() [4/6]

constexpr auto kblib::detail_units::unit_of ( std::chrono::minutes  ) -> auto
constexprnoexcept

Definition at line 282 of file convert.h.

◆ unit_of() [5/6]

constexpr auto kblib::detail_units::unit_of ( std::chrono::nanoseconds  ) -> auto
constexprnoexcept

Definition at line 265 of file convert.h.

◆ unit_of() [6/6]

constexpr auto kblib::detail_units::unit_of ( std::chrono::seconds  ) -> auto
constexprnoexcept

Definition at line 278 of file convert.h.