new config function are more useful in pratice.

v1
Brett 2024-09-14 16:35:09 -04:00
parent 0869509c6a
commit 494125214f
3 changed files with 8 additions and 31 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.20) cmake_minimum_required(VERSION 3.20)
include(cmake/color.cmake) 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_TEST_VERSION 0.0.1)
set(BLT_TARGET BLT) set(BLT_TARGET BLT)

View File

@ -23,14 +23,11 @@
namespace blt namespace blt
{ {
#define BLT_MAKE_VARIABLE(TYPE, NAME) \ #define BLT_MAKE_GETTER(TYPE, NAME) \
TYPE NAME{};
#define BLT_INTERNAL_MAKE_GETTER(TYPE, NAME) \
TYPE& get_##NAME() { return NAME; } \ TYPE& get_##NAME() { return NAME; } \
const TYPE& get_##NAME() const { 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) \ auto& set_##NAME(const TYPE& new_##NAME) \
{ \ { \
NAME = new_##NAME; \ NAME = new_##NAME; \
@ -42,32 +39,12 @@ namespace blt
return *this; \ return *this; \
} }
#define BLT_MAKE_GETTER(TYPE, NAME) \ #define BLT_MAKE_GETTER_AND_SETTER(TYPE, NAME) \
private: \ BLT_MAKE_GETTER(TYPE, NAME) \
BLT_MAKE_VARIABLE(TYPE, NAME) \ BLT_MAKE_SETTER(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_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)
#define BLT_MAKE_CONFIG_TYPE(OBJECT, ...) \ #define BLT_MAKE_CONFIG_TYPE(OBJECT, ...) \
class OBJECT { \ class OBJECT { \
__VA_ARGS__ \ __VA_ARGS__ \

@ -1 +1 @@
Subproject commit 8a889d3699b3c09ade435641fb034427f3fd12b6 Subproject commit 63acc3336f941c6f324c88eb9ee4ce623a460cd5