Elements 6.1.2
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 <cstdint> // for int64_t
30#include <map> // for map
31#include <string> // for string
32
34
35namespace Elements {
36inline namespace Kernel {
37namespace Units {
38
39enum class StorageType {
40 Byte,
51};
52
55
56template <typename T>
57ELEMENTS_API T roundToDigits(const T& value, const std::size_t& max_digits);
58// explicit instantiation:
59extern template ELEMENTS_API double roundToDigits<double>(const double& value, const std::size_t& max_digits);
60extern template ELEMENTS_API float roundToDigits<float>(const float& value, const std::size_t& max_digits);
61
62template <std::size_t max_digits, typename T>
63ELEMENTS_API T storageConvert(const T& size, StorageType source_unit, StorageType target_unit);
64
65template <typename T>
66ELEMENTS_API T storageConvert(const T& size, StorageType source_unit, StorageType target_unit);
67// explicit instantiation:
68extern template ELEMENTS_API double storageConvert<double>(const double& size, StorageType source_unit,
69 StorageType target_unit);
70extern template ELEMENTS_API float storageConvert<float>(const float& size, StorageType source_unit,
71 StorageType target_unit);
73storageConvert<std::int64_t>(const std::int64_t& size, StorageType source_unit, StorageType target_unit);
74
75} // namespace Units
76} // namespace Kernel
77} // namespace Elements
78
79#define ELEMENTSKERNEL_ELEMENTSKERNEL_STORAGE_IMPL_
81#undef ELEMENTSKERNEL_ELEMENTSKERNEL_STORAGE_IMPL_
82
83#endif // ELEMENTSKERNEL_ELEMENTSKERNEL_STORAGE_H_
84
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)