|
|
|
@ -1,72 +1,17 @@
|
|
|
|
|
#pragma once |
|
|
|
|
#include "actiongenintfile.h" |
|
|
|
|
#include "actioninfo.h" |
|
|
|
|
#include "actiontsc.h" |
|
|
|
|
#include "actionuv.h" |
|
|
|
|
#include "basedata.h" |
|
|
|
|
#include "mdatetime.h" |
|
|
|
|
#include "mregex.h" |
|
|
|
|
#include "uvdata.h" |
|
|
|
|
#include "varhelpers.h" |
|
|
|
|
|
|
|
|
|
using michlib::BFileW; |
|
|
|
|
using michlib::MDateTime; |
|
|
|
|
|
|
|
|
|
using TIndex = std::vector<size_t>; |
|
|
|
|
|
|
|
|
|
enum class ActionID |
|
|
|
|
{ |
|
|
|
|
INFO, |
|
|
|
|
TSC, |
|
|
|
|
UV, |
|
|
|
|
GENINTFILE |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
template<ActionID id> struct ActionName; |
|
|
|
|
|
|
|
|
|
template<> struct ActionName<ActionID::INFO> |
|
|
|
|
{ |
|
|
|
|
static constexpr const char* name = "info"; |
|
|
|
|
}; |
|
|
|
|
template<> struct ActionName<ActionID::TSC> |
|
|
|
|
{ |
|
|
|
|
static constexpr const char* name = "tsc"; |
|
|
|
|
}; |
|
|
|
|
template<> struct ActionName<ActionID::UV> |
|
|
|
|
{ |
|
|
|
|
static constexpr const char* name = "uv"; |
|
|
|
|
}; |
|
|
|
|
template<> struct ActionName<ActionID::GENINTFILE> |
|
|
|
|
{ |
|
|
|
|
static constexpr const char* name = "genintfile"; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
template<ActionID id> struct ActionCarrier: public ActionName<id> |
|
|
|
|
{ |
|
|
|
|
constexpr static ActionID action = id; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
template<class T, ActionID id> struct IsActionSupportedTest |
|
|
|
|
{ |
|
|
|
|
static constexpr bool ans = false; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
template<class T> struct IsActionSupportedTest<T, ActionID::INFO> |
|
|
|
|
{ |
|
|
|
|
static constexpr bool ans = InfoSupported<T>; |
|
|
|
|
}; |
|
|
|
|
template<class T> struct IsActionSupportedTest<T, ActionID::TSC> |
|
|
|
|
{ |
|
|
|
|
static constexpr bool ans = ReadPSupported<T> || ReadSupported<T>; |
|
|
|
|
}; |
|
|
|
|
template<class T> struct IsActionSupportedTest<T, ActionID::UV> |
|
|
|
|
{ |
|
|
|
|
static constexpr bool ans = ReadPSupported<T> || ReadSupported<T>; |
|
|
|
|
}; |
|
|
|
|
template<class T> struct IsActionSupportedTest<T, ActionID::GENINTFILE> |
|
|
|
|
{ |
|
|
|
|
static constexpr bool ans = ReadIsGrid<T>; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
template<class T, ActionID id> constexpr bool IsActionSupported = IsActionSupportedTest<T, id>::ans; |
|
|
|
|
|
|
|
|
|
using ActionVariants = std::variant<ActionCarrier<ActionID::INFO>, ActionCarrier<ActionID::TSC>, ActionCarrier<ActionID::UV>, ActionCarrier<ActionID::GENINTFILE>>; |
|
|
|
|
using ActionVariants = std::variant<ActionInfo, ActionTSC, ActionUV, ActionGenIntFile>; |
|
|
|
|
|
|
|
|
|
class Action: public ActionVariants |
|
|
|
|
{ |
|
|
|
@ -82,13 +27,6 @@ class Action: public ActionVariants
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
template<class D, ActionID id> struct DoAction_ |
|
|
|
|
{ |
|
|
|
|
static MString DoAction(const CLArgs& args, D& data) { return "Internal error"; } |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
template<ActionID id, class D> MString DoAction(const CLArgs& args, D& data) { return DoAction_<D, id>::DoAction(args, data); } |
|
|
|
|
|
|
|
|
|
template<class D> size_t GetTIndex(const D& data, const MDateTime& t) |
|
|
|
|
{ |
|
|
|
|
size_t nt = data.NTimes(); |
|
|
|
|