RaftLib  0.3a
C++ Stream Processing Template Library
units.hpp
1 
20 #ifndef _UNITS_HPP_
21 #define _UNITS_HPP_ 1
22 
24 enum Unit : std::size_t { Byte = 0, KB, MB, GB, TB, N };
25 
27 static constexpr std::array< double,
28  Unit::N > unit_conversion
29  = {{ 1 ,
30  0.000976562 ,
31  9.53674e-7 ,
32  9.31323e-10 ,
33  9.09495e-13 }};
34 
35 static constexpr std::array< const char[3] ,
36  Unit::N > unit_prints
37  = {{ "B", "KB", "MB", "GB", "TB" }};
38 
39 #endif /* END _UNITS_HPP_ */