XX CMake Package
Loading...
Searching...
No Matches
XXFunctionCaller.h
Go to the documentation of this file.
1#ifndef XXFunctionCallerH
2#define XXFunctionCallerH
3
5
6#include <QList>
7
8namespace XX
9{
10 namespace Function
11 {
13 {
14 protected:
15 AbstractCaller() = default;
16 };
17
20
21 template <typename T>
22 concept CallerClass = requires(T instance) //
23 {
24 std::is_base_of<AbstractCaller, T>::value;
25 };
26
29
30 template <CompileTimeString tag>
31 class Caller : public AbstractCaller
32 {
33 public:
35 virtual ~Caller() = 0;
36
37 protected:
38 template <CallerClass TargetClass, typename... Args>
39 static void callOnAll(void (TargetClass::*function)(Args...), Args... values);
40
41 template <CallerClass TargetClass>
42 static void callOnAll(void (TargetClass::*function)());
43
44 static size_t instanceCount();
45
46 private:
47 static QList<Caller*> instances;
48 };
49 } // namespace Function
50} // namespace XX
51
52#ifndef XXFunctionCallerHPP
53#include "XXFunctionCaller.hpp"
54#endif // NOT XXFunctionCallerHPP
55
56#endif // NOT XXFunctionCallerH
static size_t instanceCount()
static void callOnAll(void(TargetClass::*function)(Args...), Args... values)
static void callOnAll(void(TargetClass::*function)())
concept of a function caller class
Definition XXFunctionCaller.h:22
Definition XXFunctionCaller.h:11
Definition XXPopulatedAbstract.h:11