mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Core: Consolidate typed container logic
This commit is contained in:
parent
1e9d0ff925
commit
7390c358f5
6 changed files with 117 additions and 451 deletions
|
|
@ -70,6 +70,10 @@ template <typename T>
|
|||
class Ref;
|
||||
template <typename T>
|
||||
class BitField;
|
||||
template <typename T>
|
||||
class TypedArray;
|
||||
template <typename K, typename V>
|
||||
class TypedDictionary;
|
||||
|
||||
struct PropertyInfo;
|
||||
struct MethodInfo;
|
||||
|
|
@ -495,6 +499,10 @@ public:
|
|||
_FORCE_INLINE_ operator T() const { return static_cast<T>(operator int64_t()); }
|
||||
template <typename T>
|
||||
_FORCE_INLINE_ operator BitField<T>() const { return static_cast<T>(operator uint64_t()); }
|
||||
template <typename T>
|
||||
_FORCE_INLINE_ operator TypedArray<T>() const { return operator Array(); }
|
||||
template <typename K, typename V>
|
||||
_FORCE_INLINE_ operator TypedDictionary<K, V>() const { return operator Dictionary(); }
|
||||
|
||||
Object *get_validated_object() const;
|
||||
Object *get_validated_object_with_check(bool &r_previously_freed) const;
|
||||
|
|
@ -565,6 +573,12 @@ public:
|
|||
template <typename T>
|
||||
_FORCE_INLINE_ Variant(BitField<T> p_bitfield) :
|
||||
Variant(static_cast<uint64_t>(p_bitfield)) {}
|
||||
template <typename T>
|
||||
_FORCE_INLINE_ Variant(const TypedArray<T> &p_typed_array) :
|
||||
Variant(static_cast<const Array &>(p_typed_array)) {}
|
||||
template <typename K, typename V>
|
||||
_FORCE_INLINE_ Variant(const TypedDictionary<K, V> &p_typed_dictionary) :
|
||||
Variant(static_cast<const Dictionary &>(p_typed_dictionary)) {}
|
||||
|
||||
// If this changes the table in variant_op must be updated
|
||||
enum Operator {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue