summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/pso/macros.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/include/pso/macros.h b/include/pso/macros.h
index 1434e16..a341b7f 100644
--- a/include/pso/macros.h
+++ b/include/pso/macros.h
@@ -57,4 +57,40 @@
#define __packed__
+#define PRIVATE_MEMBER_GETTER(type, name) \
+ type name() { \
+ return m_##name; \
+ }
+
+#define PRIVATE_MEMBER_SETTER(type, name) \
+ void set_##name(type val) { \
+ m_##name = val; \
+ }
+
+#define PRIVATE_MEMBER_GETTER_ARRAY(type, name, size) \
+ TArray<type, size> &name() { \
+ return m_##name; \
+ }
+
+#define PRIVATE_MEMBER_GETTER_FUNC(ret_type, name, ...) \
+ ret_type (*name())(__VA_ARGS__) { \
+ return m_##name; \
+ }
+
+#define PRIVATE_MEMBER_SETTER_FUNC(ret_type, name, ...) \
+ void set_##name(ret_type (*val)(__VA_ARGS__)) { \
+ m_##name = val; \
+ }
+
+#define PRIVATE_MEMBER_ACCESSORS(type, name) \
+ PRIVATE_MEMBER_GETTER(type, name); \
+ PRIVATE_MEMBER_SETTER(type, name)
+
+#define PRIVATE_MEMBER_ACCESSORS_ARRAY(type, name, size) \
+ PRIVATE_MEMBER_GETTER_ARRAY(type, name, size)
+
+#define PRIVATE_MEMBER_ACCESSORS_FUNC(ret_type, name, ...) \
+ PRIVATE_MEMBER_GETTER_FUNC(ret_type, name, __VA_ARGS__); \
+ PRIVATE_MEMBER_SETTER_FUNC(ret_type, name, __VA_ARGS__)
+
#endif