Elements 6.3.1
A C++ base framework for the Euclid Software.
Loading...
Searching...
No Matches
Storage.h
Go to the documentation of this file.
1
26#ifndef ELEMENTSKERNEL_ELEMENTSKERNEL_STORAGE_H_
27#define ELEMENTSKERNEL_ELEMENTSKERNEL_STORAGE_H_
28
29#include <cstddef> // for size_t
30#include <cstdint> // for int64_t
31#include <map> // for map
32#include <string> // for string
33
35
36namespace Elements {
37inline namespace Kernel {
38namespace Units {
39
53
56
57template <typename T>
58ELEMENTS_API T roundToDigits(const T& value, const std::size_t& max_digits);
59// explicit instantiation:
60extern template ELEMENTS_API double roundToDigits<double>(const double& value, const std::size_t& max_digits);
61extern template ELEMENTS_API float roundToDigits<float>(const float& value, const std::size_t& max_digits);
62
63template <std::size_t max_digits, typename T>
64ELEMENTS_API T storageConvert(const T& size, StorageType source_unit, StorageType target_unit);
65
66template <typename T>
67ELEMENTS_API T storageConvert(const T& size, StorageType source_unit, StorageType target_unit);
68// explicit instantiation:
69extern template ELEMENTS_API double storageConvert<double>(const double& size, StorageType source_unit,
70 StorageType target_unit);
71extern template ELEMENTS_API float storageConvert<float>(const float& size, StorageType source_unit,
72 StorageType target_unit);
74storageConvert<std::int64_t>(const std::int64_t& size, StorageType source_unit, StorageType target_unit);
75
76} // namespace Units
77} // namespace Kernel
78} // namespace Elements
79
80#define ELEMENTSKERNEL_ELEMENTSKERNEL_STORAGE_IMPL_
81#include "ElementsKernel/_impl/Storage.tpp" // IWYU pragma: export
82#undef ELEMENTSKERNEL_ELEMENTSKERNEL_STORAGE_IMPL_
83
84#endif // ELEMENTSKERNEL_ELEMENTSKERNEL_STORAGE_H_
85
defines the macros to be used for explicit export of the symbols
#define ELEMENTS_API
Dummy definitions for the backward compatibility mode.
Definition Export.h:74
template ELEMENTS_API float roundToDigits< float >(const float &value, const std::size_t &max_digits)
ELEMENTS_API T storageConvert(const T &size, StorageType source_unit, StorageType target_unit)
template ELEMENTS_API float storageConvert< float >(const float &size, StorageType source_unit, StorageType target_unit)
ELEMENTS_API T roundToDigits(const T &value, const std::size_t &max_digits)
ELEMENTS_API std::map< StorageType, std::string > StorageShortName
Definition Storage.cpp:38
template ELEMENTS_API double roundToDigits< double >(const double &value, const std::size_t &max_digits)
ELEMENTS_API std::map< StorageType, std::int64_t > StorageFactor
Definition Storage.cpp:50
template ELEMENTS_API std::int64_t storageConvert< std::int64_t >(const std::int64_t &size, StorageType source_unit, StorageType target_unit)
template ELEMENTS_API double storageConvert< double >(const double &size, StorageType source_unit, StorageType target_unit)