18 #include <type_traits>
44 typedef enum {
INST=0,
M5,
M10,
M30,
H1,
DAY,
WEEK,
MONTH,
TRIM,
YEAR,
not_a_time }
ETime;
48 enum class ETime : unsigned int {
INST=0,
M5,
M10,
M30,
H1,
DAY,
WEEK,
MONTH,
TRIM,
YEAR,
not_a_time };
58 template <
typename ETime>
64 return static_cast<unsigned int>(value);
std::ostream & operator<<(std::ostream &os, const ETime &obj)
allow to print the string format "DAY", to get the integer use TimeScale::as_uint() function ...
auto as_uint(ETime const value) -> unsigned int
Provides explicit conversion to unsigned int.
ETime
Enumeration for the different time representation, from instantaneous (INST) to year(YEAR) ...
ETime GetTimeScaleFromName(const std::string &tmscl_str)
From name "DAY", get ETime::DAY.
std::string GetTimeScaleName(const ETime &tmscl)
Get the string, i.e., "DAY".