11#include <promeki/config.h>
12#if PROMEKI_ENABLE_CORE
21PROMEKI_NAMESPACE_BEGIN
42template <
typename... Args>
class Slot {
45 using Function = promeki::Function<void(Args...)>;
54 Slot(
const Function &func,
void *owner =
nullptr,
const char *prototype =
nullptr,
int id = -1)
55 : _owner(owner), _prototype(prototype), _id(id), _function(func) {}
58 void *owner()
const {
return _owner; }
61 const char *prototype()
const {
return _prototype; }
64 int id()
const {
return _id; }
67 void setID(
int val) { _id = val; }
73 template <
typename T>
struct removeConstAndRef {
74 using type = std::remove_const_t<std::remove_reference_t<T>>;
78 template <
typename T>
using RemoveConstAndRef =
typename removeConstAndRef<T>::type;
94 static VariantList pack(Args... args);
100 void exec(Args... args) {
117 void exec(
const VariantList &variantList);
120 void *_owner =
nullptr;
121 const char *_prototype =
nullptr;
125 template <std::size_t... Idx>
126 void execFromVariantList(std::index_sequence<Idx...>,
const VariantList &variantList);
128 template <std::
size_t Idx>
decltype(
auto) unpackVariant(
const Variant &variant);