qtty-cpp 0.4.5
Header-only C++ wrapper for qtty
Loading...
Searching...
No Matches
current.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-3-Clause
2// Copyright (C) 2026 Vallés Puig, Ramon
3
4#pragma once
5
6#include "../ffi_core.hpp"
7
8namespace qtty {
9
10struct AmpereTag {};
13struct KiloampereTag {};
14
15template <> struct UnitTraits<AmpereTag> {
16 static constexpr UnitId unit_id() { return UNIT_ID_AMPERE; }
17 static constexpr std::string_view symbol() { return "A"; }
18 static constexpr DimensionId dimension() { return DIMENSION_ID_CURRENT; }
19};
20template <> struct UnitTraits<MicroampereTag> {
21 static constexpr UnitId unit_id() { return UNIT_ID_MICROAMPERE; }
22 static constexpr std::string_view symbol() { return "µA"; }
23 static constexpr DimensionId dimension() { return DIMENSION_ID_CURRENT; }
24};
25template <> struct UnitTraits<MilliampereTag> {
26 static constexpr UnitId unit_id() { return UNIT_ID_MILLIAMPERE; }
27 static constexpr std::string_view symbol() { return "mA"; }
28 static constexpr DimensionId dimension() { return DIMENSION_ID_CURRENT; }
29};
30template <> struct UnitTraits<KiloampereTag> {
31 static constexpr UnitId unit_id() { return UNIT_ID_KILOAMPERE; }
32 static constexpr std::string_view symbol() { return "kA"; }
33 static constexpr DimensionId dimension() { return DIMENSION_ID_CURRENT; }
34};
35
40
41} // namespace qtty
constexpr bool is_angular_v
Definition angles.hpp:49
static constexpr DimensionId dimension()
Definition current.hpp:18
static constexpr UnitId unit_id()
Definition current.hpp:16
static constexpr std::string_view symbol()
Definition current.hpp:17
static constexpr std::string_view symbol()
Definition current.hpp:32
static constexpr UnitId unit_id()
Definition current.hpp:31
static constexpr DimensionId dimension()
Definition current.hpp:33
static constexpr std::string_view symbol()
Definition current.hpp:22
static constexpr DimensionId dimension()
Definition current.hpp:23
static constexpr UnitId unit_id()
Definition current.hpp:21
static constexpr std::string_view symbol()
Definition current.hpp:27
static constexpr UnitId unit_id()
Definition current.hpp:26
static constexpr DimensionId dimension()
Definition current.hpp:28