From 494125214f334c2e853469901efadb6a1ab941ac Mon Sep 17 00:00:00 2001 From: Brett Date: Sat, 14 Sep 2024 16:35:09 -0400 Subject: [PATCH] new config function are more useful in pratice. --- CMakeLists.txt | 2 +- include/blt/meta/config_generator.h | 35 +++++------------------------ libraries/parallel-hashmap | 2 +- 3 files changed, 8 insertions(+), 31 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e35442..5dfef7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.20) include(cmake/color.cmake) -set(BLT_VERSION 0.20.3) +set(BLT_VERSION 0.20.4) set(BLT_TEST_VERSION 0.0.1) set(BLT_TARGET BLT) diff --git a/include/blt/meta/config_generator.h b/include/blt/meta/config_generator.h index 58abcb8..efe06ae 100644 --- a/include/blt/meta/config_generator.h +++ b/include/blt/meta/config_generator.h @@ -23,14 +23,11 @@ namespace blt { -#define BLT_MAKE_VARIABLE(TYPE, NAME) \ - TYPE NAME{}; - -#define BLT_INTERNAL_MAKE_GETTER(TYPE, NAME) \ +#define BLT_MAKE_GETTER(TYPE, NAME) \ TYPE& get_##NAME() { return NAME; } \ const TYPE& get_##NAME() const { return NAME; } -#define BLT_INTERNAL_MAKE_SETTER(TYPE, NAME) \ +#define BLT_MAKE_SETTER(TYPE, NAME) \ auto& set_##NAME(const TYPE& new_##NAME) \ { \ NAME = new_##NAME; \ @@ -42,31 +39,11 @@ namespace blt return *this; \ } -#define BLT_MAKE_GETTER(TYPE, NAME) \ - private: \ - BLT_MAKE_VARIABLE(TYPE, NAME) \ - public: \ - BLT_INTERNAL_MAKE_GETTER(TYPE, NAME) - -#define BLT_MAKE_SETTER(TYPE, NAME) \ - private: \ - BLT_MAKE_VARIABLE(TYPE, NAME) \ - public: \ - BLT_INTERNAL_MAKE_SETTER(TYPE, NAME) - -#define BLT_MAKE_FRIEND(FRIEND) friend FRIEND; - -//#define BLT_MAKE_ARG(TYPE, NAME) TYPE, NAME -//#define INTERNAL_BLT_ARG_INPUT(TYPE, NAME) TYPE NAME -//#define INTERNAL_BLT_ARG_ASSIGNMENT(TYPE, NAME) _##NAME(NAME) -//#define BLT_MAKE_CONSTRUCTOR(OBJECT, ...) OBJECT() - #define BLT_MAKE_GETTER_AND_SETTER(TYPE, NAME) \ - private: \ - BLT_MAKE_VARIABLE(TYPE, NAME) \ - public: \ - BLT_INTERNAL_MAKE_GETTER(TYPE, NAME) \ - BLT_INTERNAL_MAKE_SETTER(TYPE, NAME) + BLT_MAKE_GETTER(TYPE, NAME) \ + BLT_MAKE_SETTER(TYPE, NAME) + +#define BLT_MAKE_FRIEND(FRIEND) friend FRIEND; #define BLT_MAKE_CONFIG_TYPE(OBJECT, ...) \ class OBJECT { \ diff --git a/libraries/parallel-hashmap b/libraries/parallel-hashmap index 8a889d3..63acc33 160000 --- a/libraries/parallel-hashmap +++ b/libraries/parallel-hashmap @@ -1 +1 @@ -Subproject commit 8a889d3699b3c09ade435641fb034427f3fd12b6 +Subproject commit 63acc3336f941c6f324c88eb9ee4ce623a460cd5