28template <
typename...
Args>
45 void *
owner()
const {
return _owner; }
48 const char *
prototype()
const {
return _prototype; }
51 int id()
const {
return _id; }
61 using type = std::remove_const_t<std::remove_reference_t<T>>;
99 execFromVariantList(std::make_index_sequence<
sizeof...(
Args)>(),
variantList);
103 void *_owner =
nullptr;
104 const char *_prototype =
nullptr;
112 template <std::
size_t Idx>
decltype(
auto) unpackVariant(
const Variant &
variant) {
Dynamic array container wrapping std::vector.
Definition list.h:40
Type-safe callback slot that wraps a callable with optional ownership tracking.
Definition slot.h:29
void setID(int val)
Sets the numeric identifier for this slot.
Definition slot.h:54
static VariantList pack(Args... args)
Packs the given arguments into a VariantList.
Definition slot.h:77
const char * prototype() const
Returns the prototype string associated with this slot.
Definition slot.h:48
int id() const
Returns the numeric identifier for this slot.
Definition slot.h:51
std::function< void(Args...)> Function
Callable type that the slot wraps.
Definition slot.h:32
void * owner() const
Returns the owner pointer associated with this slot.
Definition slot.h:45
typename removeConstAndRef< T >::type RemoveConstAndRef
Convenience alias for removeConstAndRef.
Definition slot.h:65
void exec(const VariantList &variantList)
Executes the slot's callable by unpacking arguments from a VariantList.
Definition slot.h:98
Slot(const Function &func, void *owner=nullptr, const char *prototype=nullptr, int id=-1)
Constructs a Slot with the given callable and optional metadata.
Definition slot.h:41
void exec(Args... args)
Executes the slot's callable with the given typed arguments.
Definition slot.h:85
#define PROMEKI_NAMESPACE_BEGIN
Starts a promeki namespace block.
Definition namespace.h:14
#define PROMEKI_NAMESPACE_END
Ends a promeki namespace block.
Definition namespace.h:19
Helper trait that strips const qualification and references from a type.
Definition slot.h:60
VariantImpl< std::monostate, bool, uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double, String, DateTime, TimeStamp, Size2Du32, UUID, Timecode, Rational< int >, detail::VariantEnd > Variant
Concrete variant type instantiated with every type from PROMEKI_VARIANT_TYPES.
Definition variant.h:362