From 91d688bb6252df780a560d8a9ed7a2762a3a1503 Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Mon, 22 Jan 2024 08:48:51 -0500 Subject: [PATCH] small func update --- cmake-build-release/Testing/Temporary/LastTest.log | 4 ++-- include/functions.h | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/cmake-build-release/Testing/Temporary/LastTest.log b/cmake-build-release/Testing/Temporary/LastTest.log index 63eb327..eb0b93a 100644 --- a/cmake-build-release/Testing/Temporary/LastTest.log +++ b/cmake-build-release/Testing/Temporary/LastTest.log @@ -1,3 +1,3 @@ -Start testing: Jan 19 15:13 EST +Start testing: Jan 22 08:33 EST ---------------------------------------------------------- -End testing: Jan 19 15:13 EST +End testing: Jan 22 08:33 EST diff --git a/include/functions.h b/include/functions.h index 6614fb0..8553aa7 100644 --- a/include/functions.h +++ b/include/functions.h @@ -24,12 +24,16 @@ #include #include +#include "blt/std/hashmap.h" +#include "blt/std/types.h" template using allowed_funcs = std::vector; class empty {}; +// #define FUNC_DEFINE(NAME, REQUIRED_ARGS, FUNC, ALLOWED) + #define FUNC_ALLOW_ANY std::vector(); #define FUNC_ALLOW_NONE std::vector(); @@ -47,6 +51,7 @@ class empty {}; FUNC_DEFINE(SQRT, 1, void(), allowed_funcs(FUNC_ALLOW_ANY, FUNC_ALLOW_ANY)) \ #undef FUNC_ALLOW_ANY +#undef FUNC_ALLOW_NONE #define FUNC_DEFINE(NAME, REQUIRED_ARGS, FUNC, ALLOWED) NAME, enum class function_t @@ -57,9 +62,18 @@ enum class function_t #define FUNC_DEFINE(NAME, REQUIRED_ARGS, FUNC, ALLOWED) function_t::NAME, static inline allowed_funcs FUNC_ALLOW_ANY_LIST{FUNC_FUNCTIONS}; +static inline allowed_funcs FUNC_ALLOW_NONE_LIST{}; #define FUNC_ALLOW_ANY FUNC_ALLOW_ANY_LIST +#define FUNC_ALLOW_NONE FUNC_ALLOW_NONE_LIST #undef FUNC_DEFINE +#define FUNC_DEFINE(NAME, REQUIRED_ARGS, FUNC, ALLOWED) {REQUIRED_ARGS, function_t::NAME}, +HASHMAP function_arg_map = { + FUNC_FUNCTIONS +}; +#undef FUNC_DEFINE + + //enum class function_t //{ // // FUNC // inputs