22 is_builtin_convertible_v<T>,
42 is_alias_pointer_v<T>,
52 is_active_effect_pointer_v<T>,
64 is_reference_wrapper<T>>,
68 using value_type =
typename T::value_type;
69 if constexpr (is_builtin_convertible_v<value_type>) {
71 }
else if constexpr (is_form_pointer_v<value_type>) {
73 }
else if constexpr (is_alias_pointer_v<value_type> || is_active_effect_pointer_v<value_type>) {
76 static_assert(
sizeof(T) &&
false);
82 class U = std::decay_t<T>,
84 is_string_convertible_v<U>,
93 class U = std::decay_t<T>,
95 is_signed_integral_convertible_v<U>,
97 inline void PackValue(Variable* a_dst, T&& a_src)
100 a_dst->SetSInt(
static_cast<std::int32_t
>(std::forward<T>(a_src)));
104 class U = std::decay_t<T>,
106 is_unsigned_integral_convertible_v<U>,
108 inline void PackValue(Variable* a_dst, T&& a_src)
111 a_dst->SetUInt(
static_cast<std::uint32_t
>(std::forward<T>(a_src)));
116 class U = std::decay_t<T>,
118 is_floating_point_convertible_v<U>,
120 inline void PackValue(Variable* a_dst, T&& a_src)
123 a_dst->SetFloat(
static_cast<float>(std::forward<T>(a_src)));
128 class U = std::decay_t<T>,
132 inline void PackValue(Variable* a_dst, T&& a_src)
135 a_dst->SetBool(
static_cast<bool>(std::forward<T>(a_src)));
140 class U = std::decay_t<T>,
142 is_form_pointer_v<U>,
144 inline void PackValue(Variable* a_dst, T&& a_src)
146 PackHandle(a_dst, std::forward<T>(a_src),
static_cast<VMTypeID>(decay_pointer_t<U>::FORMTYPE));
151 class U = std::decay_t<T>,
153 is_alias_pointer_v<U>,
155 inline void PackValue(Variable* a_dst, T&& a_src)
157 PackHandle(a_dst, std::forward<T>(a_src), decay_pointer_t<U>::VMTYPEID);
162 class U = std::decay_t<T>,
164 is_active_effect_pointer_v<U>,
166 inline void PackValue(Variable* a_dst, T&& a_src)
168 PackHandle(a_dst, std::forward<T>(a_src), decay_pointer_t<U>::VMTYPEID);
173 class U = std::decay_t<T>,
177 void PackValue(Variable* a_dst, T&& a_src);
182 is_static_base_pointer_v<T>,
186 return static_cast<T
>(
nullptr);
192 is_string_convertible_v<T>,
194 [[nodiscard]]
inline T
UnpackValue(
const Variable* a_src)
197 return T{ a_src->GetString() };
203 is_signed_integral_convertible_v<T>,
205 [[nodiscard]]
inline T
UnpackValue(
const Variable* a_src)
208 return static_cast<T
>(a_src->GetSInt());
214 is_unsigned_integral_convertible_v<T>,
216 [[nodiscard]]
inline T
UnpackValue(
const Variable* a_src)
219 return static_cast<T
>(a_src->GetUInt());
225 is_floating_point_convertible_v<T>,
227 [[nodiscard]]
inline T
UnpackValue(
const Variable* a_src)
230 return static_cast<T
>(a_src->GetFloat());
238 [[nodiscard]]
inline T
UnpackValue(
const Variable* a_src)
241 return static_cast<T
>(a_src->GetBool());
247 is_form_pointer_v<T>,
249 [[nodiscard]]
inline T
UnpackValue(
const Variable* a_src)
251 return static_cast<T
>(
UnpackHandle(a_src,
static_cast<VMTypeID>(decay_pointer_t<T>::FORMTYPE)));
257 is_alias_pointer_v<T>,
259 [[nodiscard]]
inline T
UnpackValue(
const Variable* a_src)
261 return static_cast<T
>(
UnpackHandle(a_src, decay_pointer_t<T>::VMTYPEID));
267 is_active_effect_pointer_v<T>,
269 [[nodiscard]]
inline T
UnpackValue(
const Variable* a_src)
271 return static_cast<T
>(
UnpackHandle(a_src, decay_pointer_t<T>::VMTYPEID));
279 [[nodiscard]] T
UnpackValue(
const Variable* a_src);
284 is_reference_wrapper_v<T>,
294 PackValue<T>(
this, std::forward<T>(a_src));
300 return UnpackValue<T>(
this);
RawType
Definition: TypeInfo.h:13
Definition: Variable.h:15
void SetString(std::string_view a_val)
void Pack(T &&a_src)
Definition: PackUnpack.h:292
T Unpack() const
Definition: PackUnpack.h:298
Definition: BSTSmartPointer.h:37
TypeInfo::RawType GetRawTypeFromVMType(VMTypeID a_typeID)
T UnpackValue(const Variable *a_src)
Definition: PackUnpack.h:184
void PackHandle(Variable *a_dst, const void *a_src, VMTypeID a_typeID)
TypeInfo::RawType GetRawType()
Definition: PackUnpack.h:24
void * UnpackHandle(const Variable *a_src, VMTypeID a_typeID)
void PackValue(Variable *a_dst, T &&a_src)
Definition: PackUnpack.h:86
void BindID(BSTSmartPointer< Object > &a_object, const void *a_src, VMTypeID a_typeID)
Definition: AbsorbEffect.h:6
std::uint32_t VMTypeID
Definition: BSCoreTypes.h:9