dimval 0.2.0
Modern C++23 header-only library of dimensional values (units, measures, ranges)
Loading...
Searching...
No Matches
rate.hpp
Go to the documentation of this file.
1#pragma once
2
6
7#include <dimval/define.hpp>
8
9DIMVAL_DEFINE_UNIT(BitPerSecond,
10 "bit/s",
11 "bit/s",
12 "bit/s",
13 "bits per second",
14 "data_rate",
15 1.0,
16 ::comms::Icons::mdi::transfer,
17 ::comms::Colors::mui::cyan[400],
18 static constexpr ::std::string_view formatter = "bitrate";
19 static constexpr int default_precision = 2;)
20
21DIMVAL_DEFINE_UNIT(BytePerSecond,
22 "B/s",
23 "B/s",
24 "B/s",
25 "bytes per second",
26 "data_rate",
27 8.0,
28 ::comms::Icons::mdi::transfer,
29 ::comms::Colors::mui::cyan[500],
30 static constexpr ::std::string_view formatter = "bitrate";
31 static constexpr int default_precision = 2;)
Macros that expand into a CRTP unit/measure struct and a runtime auto-registration for it.
#define DIMVAL_DEFINE_UNIT(Tag, Id, Symbol, ShortName, LongName, Kind, Factor, Icon, Color,...)
Define a unit struct in ::dimval and auto-register its descriptor at static-init time.
Definition define.hpp:72