All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Typedefs
datasize.h File Reference

Dimensioned variables representing data size. More...

#include "lardataalg/Utilities/quantities.h"
#include <string_view>
#include <ratio>

Go to the source code of this file.

Classes

struct  util::quantities::units::Byte
 
struct  util::quantities::concepts::Prefix< prefixes::kibi >
 Prefix for 1024 (2^10). More...
 
struct  util::quantities::concepts::Prefix< prefixes::mebi >
 Prefix for 1048576 (2^20). More...
 
struct  util::quantities::concepts::Prefix< prefixes::gibi >
 Prefix for 1073741824 (2^30). More...
 
struct  util::quantities::concepts::Prefix< prefixes::tebi >
 Prefix for 2^40. More...
 
struct  util::quantities::concepts::Prefix< prefixes::pebi >
 Prefix for 2^50. More...
 
struct  util::quantities::concepts::Prefix< prefixes::exbi >
 Prefix for 2^60. More...
 

Namespaces

 util::quantities
 Types of variables with a unit.
 
 util::quantities::units
 Definitions of actual units.
 
 util::quantities::prefixes
 Definitions of additional prefixes.
 
 util::quantities::datasize_literals
 Literal constants for data size quantities.
 
 util::quantities::concepts
 Infrastructure for the quantities library.
 

Typedefs

using util::quantities::prefixes::kibi = std::ratio<(1LL<< 10)>
 Factor 1'024 (2^10). More...
 
using util::quantities::prefixes::mebi = std::ratio<(1LL<< 20)>
 Factor 1'048'576 (2^20). More...
 
using util::quantities::prefixes::gibi = std::ratio<(1LL<< 30)>
 Factor 1'073'741'824 (2^30). More...
 
using util::quantities::prefixes::tebi = std::ratio<(1LL<< 40)>
 Factor 2^40. More...
 
using util::quantities::prefixes::pebi = std::ratio<(1LL<< 50)>
 Factor 2^50. More...
 
using util::quantities::prefixes::exbi = std::ratio<(1LL<< 60)>
 Factor 2^60. More...
 
Data size

These time quantities are tied to util::quantities::units::Byte.

  • most general template, scaled_byte, allowing to choose both the scale of the unit (e.g. util::quantities::prefixes::mebi for mebibyte) and the type of the numerical representation
  • generic templates (e.g. byte_as), allowing to choose which numerical representation to use
  • unsigned integral number (e.g. byte), 64-bit on amd64 architecture, ready for use
template<typename R , typename T = unsigned long long int>
using util::quantities::scaled_byte = concepts::scaled_quantity< units::Byte, R, T >
 The most generic units::Byte-based quantity. More...
 
template<typename T = unsigned long long int>
using util::quantities::byte_as = scaled_byte< std::ratio< 1 >, T >
 Type of data size stored in bytes. More...
 
template<typename T = unsigned long long int>
using util::quantities::bytes_as = byte_as< T >
 Alias for common language habits. More...
 
using util::quantities::byte = byte_as<>
 Type of data size stored in bytes, in long long precision. More...
 
using util::quantities::bytes = byte
 Alias for common language habits. More...
 
template<typename T = unsigned long long int>
using util::quantities::kibibyte_as = concepts::rescale< byte_as< T >, prefixes::kibi >
 Type of data size stored in kibibytes. More...
 
template<typename T = unsigned long long int>
using util::quantities::kibibytes_as = kibibyte_as< T >
 Alias for common language habits. More...
 
using util::quantities::kibibyte = kibibyte_as<>
 Type of data size stored in kibibytes, in long long precision. More...
 
using util::quantities::kibibytes = kibibyte
 Alias for common language habits. More...
 
template<typename T = unsigned long long int>
using util::quantities::mebibyte_as = concepts::rescale< byte_as< T >, prefixes::mebi >
 Type of data size stored in mebibytes. More...
 
template<typename T = unsigned long long int>
using util::quantities::mebibytes_as = mebibyte_as< T >
 Alias for common language habits. More...
 
using util::quantities::mebibyte = mebibyte_as<>
 Type of data size stored in mebibytes, in long long precision. More...
 
using util::quantities::mebibytes = mebibyte
 Alias for common language habits. More...
 
template<typename T = unsigned long long int>
using util::quantities::gibibyte_as = concepts::rescale< byte_as< T >, prefixes::gibi >
 Type of data size stored in gibibytes. More...
 
template<typename T = unsigned long long int>
using util::quantities::gibibytes_as = gibibyte_as< T >
 Alias for common language habits. More...
 
using util::quantities::gibibyte = gibibyte_as<>
 Type of data size stored in pebibytes, in long long precision. More...
 
using util::quantities::gibibytes = gibibyte
 Alias for common language habits. More...
 
template<typename T = unsigned long long int>
using util::quantities::tebibyte_as = concepts::rescale< byte_as< T >, prefixes::tebi >
 Type of data size stored in tebibytes. More...
 
template<typename T = unsigned long long int>
using util::quantities::tebibytes_as = tebibyte_as< T >
 Alias for common language habits. More...
 
using util::quantities::tebibyte = tebibyte_as<>
 Type of data size stored in tebibytes, in long long precision. More...
 
using util::quantities::tebibytes = tebibyte
 Alias for common language habits. More...
 
template<typename T = unsigned long long int>
using util::quantities::pebibyte_as = concepts::rescale< byte_as< T >, prefixes::pebi >
 Type of data size stored in pebibytes. More...
 
template<typename T = unsigned long long int>
using util::quantities::pebibytes_as = pebibyte_as< T >
 Alias for common language habits. More...
 
using util::quantities::pebibyte = pebibyte_as<>
 Type of data size stored in pebibytes, in long long precision. More...
 
using util::quantities::pebibytes = pebibyte
 Alias for common language habits. More...
 
template<typename T = unsigned long long int>
using util::quantities::exbibyte_as = concepts::rescale< byte_as< T >, prefixes::exbi >
 Type of data size stored in exbibytes. More...
 
template<typename T = unsigned long long int>
using util::quantities::exbibytes_as = exbibyte_as< T >
 Alias for common language habits. More...
 
using util::quantities::exbibyte = exbibyte_as<>
 Type of data size stored in exbibytes, in long long precision. More...
 
using util::quantities::exbibytes = exbibyte
 Alias for common language habits. More...
 

Functions

constexpr byte util::quantities::datasize_literals::operator""_B (long double v)
 Literal second value. More...
 
constexpr byte util::quantities::datasize_literals::operator""_B (unsigned long long int v)
 
constexpr kibibyte util::quantities::datasize_literals::operator""_kiB (long double v)
 Literal kibibyte value. More...
 
constexpr kibibyte util::quantities::datasize_literals::operator""_kiB (unsigned long long int v)
 
constexpr mebibyte util::quantities::datasize_literals::operator""_MiB (long double v)
 Literal mebibyte value. More...
 
constexpr mebibyte util::quantities::datasize_literals::operator""_MiB (unsigned long long int v)
 
constexpr gibibyte util::quantities::datasize_literals::operator""_GiB (long double v)
 Literal gibibyte value. More...
 
constexpr gibibyte util::quantities::datasize_literals::operator""_GiB (unsigned long long int v)
 
constexpr tebibyte util::quantities::datasize_literals::operator""_TiB (long double v)
 Literal tebibyte value. More...
 
constexpr tebibyte util::quantities::datasize_literals::operator""_TiB (unsigned long long int v)
 
constexpr pebibyte util::quantities::datasize_literals::operator""_PiB (long double v)
 Literal pebibyte value. More...
 
constexpr pebibyte util::quantities::datasize_literals::operator""_PiB (unsigned long long int v)
 
constexpr exbibyte util::quantities::datasize_literals::operator""_EiB (long double v)
 Literal exbibyte value. More...
 
constexpr exbibyte util::quantities::datasize_literals::operator""_EiB (unsigned long long int v)
 

Detailed Description

Dimensioned variables representing data size.

Author
Gianluca Petrillo (petri.nosp@m.llo@.nosp@m.slac..nosp@m.stan.nosp@m.ford..nosp@m.edu)
Date
November 2, 2018
See Also
lardataalg/Utilities/quantities.h

Set of basic quantities related to data size. This is mostly a proof of concept for custom prefixes.

This is a header-only library.

Definition in file datasize.h.