Iguana 0.0.0
Implementation Guardian of Analysis Algorithms
Loading...
Searching...
No Matches
AlgorithmBoilerplate.h
Go to the documentation of this file.
1
3
7#define CONSTRUCT_IGUANA_ALGORITHM(ALGO_NAME, BASE_NAME) \
8 ALGO_NAME(std::string_view name = "") \
9 : BASE_NAME(name == "" ? GetClassName() : name) \
10 { \
11 m_default_config_file = GetDefaultConfigFile(); \
12 m_class_name = GetClassName(); \
13 }
14
17#define DESTROY_IGUANA_ALGORITHM(ALGO_NAME) \
18 ~ALGO_NAME() {}
19
21
26#define IGUANA_ALGORITHM_PUBLIC_MEMBERS(ALGO_NAME, ALGO_FULL_NAME, BASE_NAME) \
27 using BASE_NAME::Start; \
28 static algo_t Creator() { return std::make_unique<ALGO_NAME>(); } \
29 static std::string GetClassName() { return #ALGO_FULL_NAME; } \
30 static std::string GetDefaultConfigFile() \
31 { \
32 return ConfigFileReader::ConvertAlgoNameToConfigName(#ALGO_FULL_NAME); \
33 }
34
36#define IGUANA_ALGORITHM_PRIVATE_MEMBERS \
37 static bool s_registered;
38
40
45#define DEFINE_IGUANA_ALGORITHM_IMPL(ALGO_NAME, ALGO_FULL_NAME, BASE_NAME) \
46private: \
47 IGUANA_ALGORITHM_PRIVATE_MEMBERS \
48public: \
49 CONSTRUCT_IGUANA_ALGORITHM(ALGO_NAME, BASE_NAME) \
50 DESTROY_IGUANA_ALGORITHM(ALGO_NAME) \
51 IGUANA_ALGORITHM_PUBLIC_MEMBERS(ALGO_NAME, ALGO_FULL_NAME, BASE_NAME)
52
57#define DEFINE_IGUANA_ALGORITHM(ALGO_NAME, ALGO_FULL_NAME) \
58 DEFINE_IGUANA_ALGORITHM_IMPL(ALGO_NAME, ALGO_FULL_NAME, Algorithm)
59
64#define DEFINE_IGUANA_VALIDATOR(VDOR_NAME, VDOR_FULL_NAME) \
65 DEFINE_IGUANA_ALGORITHM_IMPL(VDOR_NAME, VDOR_FULL_NAME, Validator)
66
68
73#define REGISTER_IGUANA_ALGORITHM(ALGO_NAME, ...) \
74 bool ALGO_NAME::s_registered = AlgorithmFactory::Register(ALGO_NAME::GetClassName(), ALGO_NAME::Creator, {__VA_ARGS__});
75
78#define REGISTER_IGUANA_VALIDATOR(VDOR_NAME) \
79 REGISTER_IGUANA_ALGORITHM(VDOR_NAME)