8#include "boost/algorithm/string.hpp"
42 value = std::move(x.get_value());
147 time_duration::operator std::chrono::seconds()
const
150 a.change_dimensions(
"s");
151 return std::chrono::seconds(
int(
a.get_value()));
248 chrono::time_point<chrono::system_clock>
start = chrono::system_clock::now();
249 start += chrono::seconds(*
this);
258 chrono::time_point<chrono::system_clock> start = chrono::system_clock::now();
259 start += chrono::seconds(*
this);
260 std::time_t start_time = std::chrono::system_clock::to_time_t(start);
263 ctime_s(str,
sizeof str,&start_time);
371 dimensions =
new_mass.get_dimensions();
377 initialize_from_string(
init_mass,mass::real_dimensions);
388 dimensions =
new_mole.get_dimensions();
394 initialize_from_string(
init_mole,mole::real_dimensions);
399 int mole::get_number_of_particles()
const
Class that represents dimensions of the SI system of units. Each dimension sizes 6 bytes,...
position
Represents the position of the dimension, which can be at the numerator or at the denominator....
@ NUMERATOR
The dimension is at the numerator.
type
Represents a dimension of the SI system of units. All the dimensions of the SI system of units are su...
@ MOLE
Mole, plural moles. SI dimension of quantity. Symbol mol.
@ COULOMB
Coulomb, plural coulombs. SI dimension of charge. Special name. Symbol C.
@ GRAM
Gram, plural grams. SI dimension of mass. Symbol g.
@ BIT
Bit, plural bits. Dimension of amount of information, of each binary digit. Symbol bit.
@ SECOND
Second, plural seconds. SI dimension of time. Symbol s.
@ CANDELA
Candela, plural candelas. SI dimension of luminous intensity. Symbol cd.
@ BYTE
Byte, plural bytes. Dimension of amount of information. Symbol B.
@ KELVIN
Kelvin, plural kelvins. SI dimension of temperature. Symbol K.
@ METRE
Meter, plural meters. SI dimension of length. Symbol m.
Class that allows to handle percentages and do calculations with it easy. It supports normal percenta...
type
Represents a prefix of the SI system of units. All the prefixes of the SI system of units are support...
@ ATTO
Prefix of a factor of 10^-18.
@ YOCTO
Prefix of a factor of 10^-24.
@ RONNA
Prefix of a factor of 10^27.
@ NANO
Prefix of a factor of 10^-9.
@ MILLI
Prefix of a factor of 10^-3.
@ NONE
There is no prefix. Then, the dimension is not increased or decreased by some factor.
@ EXA
Prefix of a factor of 10^18.
@ QUETTA
Prefix of a factor of 10^30.
@ KILO
Prefix of a factor of 10^3.
@ MEGA
Prefix of a factor of 10^6.
@ HECTO
Prefix of a factor of 10^2.
@ CENTI
Prefix of a factor of 10^-2.
@ PETA
Prefix of a factor of 10^15.
@ RONTO
Prefix of a factor of 10^-27.
@ DECA
Prefix of a factor of 10^1.
@ ZEPTO
Prefix of a factor of 10^-21.
@ YOTTA
Prefix of a factor of 10^24.
@ FEMTO
Prefix of a factor of 10^-15.
@ DECI
Prefix of a factor of 10^-1.
@ MICRO
Prefix of a factor of 10^-6.
@ GIGA
Prefix of a factor of 10^9.
@ QUECTO
Prefix of a factor of 10^-30.
@ PICO
Prefix of a factor of 10^-12.
@ ZETTA
Prefix of a factor of 10^21.
@ TERA
Prefix of a factor of 10^12.
Class that allows to create scalar units, which are composed of a value (as a float) and dimensions....
vector< dimension > dimensions
Dimensions of the scalar_unit. They can be simple dimensions, composite dimensions or special names.
const vector< dimension > & get_dimensions() const
Read-only getter of the dimensions.
bool has_dimensions(const string &init_dimensions) const
Checks if the basic dimensions are the same as the initialization string of dimensions.
float value
Value of the scalar_unit. It changes automatically when the dimensions change.
const float & get_value() const
Read-only getter of the value.
static const vector< dimension > real_dimensions
string display_hours() const
string get_finish_date() const
string display_minutes() const
string display_seconds() const
string display_weeks() const
string display_months() const
string display_days() const
static const string dimensions_match
string display_as_time() const
string display_years() const
The namespace scifir contains all scifir-units, excepting the string literals, which are outside.
vector< dimension > create_base_dimensions(const string &init_dimensions)
Creates the base dimensions from an initialization string of dimensions.
mole(const percentage &new_percentage, const mole &new_mole)
mass(const percentage &new_percentage, const mass &new_mass)
vector< dimension > create_dimensions(string init_dimensions)
Creates the dimensions from an initialization string of dimensions.
#define SCALAR_UNIT_CPP(name, init_real_dimensions)