aboutsummaryrefslogtreecommitdiff
path: root/src/utils.hpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/utils.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/utils.hpp b/src/utils.hpp
index d5d4fc5..eace39e 100644
--- a/src/utils.hpp
+++ b/src/utils.hpp
@@ -10,3 +10,9 @@
#define DEFINE_GETTER(METHOD, EXPR) \
decltype(auto) METHOD() { return EXPR; }
+
+#define DEFINE_FETCHER(TYPE, NAME) \
+ void set_##NAME##_fetcher(const std::function<TYPE> &fetcher) { \
+ fetch_##NAME = fetcher; \
+ } \
+ std::function<qsizetype()> fetch_##NAME = []() { return -1; };