Fix bug with enum class in event

This commit is contained in:
Georg Hagen
2025-07-08 22:36:22 +02:00
parent d81d6ddeef
commit 0ee574e8ee
2 changed files with 5 additions and 3 deletions

View File

@@ -31,7 +31,7 @@ namespace OpenVulkano
public: public:
// Keep this in sync with all implementations! synctag: NamedEventProcessor_Parameters_SYNC_TAG // Keep this in sync with all implementations! synctag: NamedEventProcessor_Parameters_SYNC_TAG
typedef std::variant<std::string, bool, int, float, double, UUID> Parameters; typedef std::variant<std::string, bool, int, uint32_t, float, double, UUID> Parameters;
static bool HasProcessor() { return !processors.empty(); } static bool HasProcessor() { return !processors.empty(); }
@@ -237,8 +237,8 @@ namespace OpenVulkano
{ {
std::vector<INamedEventProcessor::Parameters> attributes; std::vector<INamedEventProcessor::Parameters> attributes;
attributes.reserve(sizeof...(Arguments)); attributes.reserve(sizeof...(Arguments));
if constexpr (!std::conjunction_v<std::is_enum<std::remove_reference_t<Arguments>>...>) if constexpr (!std::disjunction_v<std::is_enum<std::remove_reference_t<Arguments>>...>)
{ { // Express if no enum class is contained in the arguments
(attributes.emplace_back(args), ...); (attributes.emplace_back(args), ...);
} }
else else

View File

@@ -24,6 +24,7 @@ namespace OpenVulkano
{ std::type_index(typeid(std::string)), @encode(NSString*) }, { std::type_index(typeid(std::string)), @encode(NSString*) },
{ std::type_index(typeid(bool)), @encode(BOOL) }, { std::type_index(typeid(bool)), @encode(BOOL) },
{ std::type_index(typeid(int)), @encode(int) }, { std::type_index(typeid(int)), @encode(int) },
{ std::type_index(typeid(uint32_t)), @encode(uint32_t) },
{ std::type_index(typeid(float)), @encode(float) }, { std::type_index(typeid(float)), @encode(float) },
{ std::type_index(typeid(double)), @encode(double) }, { std::type_index(typeid(double)), @encode(double) },
{ std::type_index(typeid(UUID)), @encode(NSUUID*) } { std::type_index(typeid(UUID)), @encode(NSUUID*) }
@@ -35,6 +36,7 @@ namespace OpenVulkano
NSString* string; NSString* string;
BOOL boolean; BOOL boolean;
int integer; int integer;
uint32_t uinteger;
float fp32; float fp32;
double fp64; double fp64;
NSUUID* uuid; NSUUID* uuid;