3#include "../../Libraries/Containers/VectorMap.h"
6template <
typename Type,
typename Union>
19template <
typename Type,
typename Union>
24 template <Type enumType>
25 [[nodiscard]]
typename Union::template EnumToType<enumType>::type* getOrCreate()
30 return &val->template changeTo<enumType>();
35 template <Type enumType>
36 [[nodiscard]]
bool set(
const typename Union::template EnumToType<enumType>::type& obj)
41 res->template changeTo<enumType>() = obj;
47 template <Type enumType>
48 [[nodiscard]]
const typename Union::template EnumToType<enumType>::type* get()
const
50 auto res = flags.
get(enumType);
53 return res->template field<enumType>();
58 [[nodiscard]]
bool clear(Type enumType) {
return flags.
remove(enumType); }
60 template <Type enumType,
typename U>
61 [[nodiscard]]
bool hasValue(
const U& obj)
const
63 const auto entry = flags.
get(enumType);
66 auto field = entry->template field<enumType>();
Map of SC::TaggedUnion, where the key is TaggedUnion enumeration value.
Definition: TaggedMap.h:21
A map holding VectorMapItem key-value pairs in an unsorted Vector.
Definition: VectorMap.h:35
const Value * get(const ComparableToKey &key) const
Get the Value associated to the given key.
Definition: VectorMap.h:165
Value * getOrCreate(const ComparableToKey &key)
Get the value associated to the given key, or creates a new one if needed.
Definition: VectorMap.h:195
bool remove(const ComparableToKey &key)
Remove an item with matching key from the Map.
Definition: VectorMap.h:55