| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393 |
- //
- // Copyright (c) 2008-2017 the Urho3D project.
- //
- // Permission is hereby granted, free of charge, to any person obtaining a copy
- // of this software and associated documentation files (the "Software"), to deal
- // in the Software without restriction, including without limitation the rights
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- // copies of the Software, and to permit persons to whom the Software is
- // furnished to do so, subject to the following conditions:
- //
- // The above copyright notice and this permission notice shall be included in
- // all copies or substantial portions of the Software.
- //
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- // THE SOFTWARE.
- //
- #pragma once
- #include "../Container/HashMap.h"
- #include "../Container/Ptr.h"
- #include "../Math/Color.h"
- #include "../Math/Matrix3.h"
- #include "../Math/Matrix3x4.h"
- #include "../Math/Rect.h"
- #include "../Math/StringHash.h"
- namespace Atomic
- {
- /// Variant's supported types.
- enum VariantType
- {
- VAR_NONE = 0,
- VAR_INT,
- VAR_BOOL,
- VAR_FLOAT,
- VAR_VECTOR2,
- VAR_VECTOR3,
- VAR_VECTOR4,
- VAR_QUATERNION,
- VAR_COLOR,
- VAR_STRING,
- VAR_BUFFER,
- VAR_VOIDPTR,
- VAR_RESOURCEREF,
- VAR_RESOURCEREFLIST,
- VAR_VARIANTVECTOR,
- VAR_VARIANTMAP,
- VAR_INTRECT,
- VAR_INTVECTOR2,
- VAR_PTR,
- VAR_MATRIX3,
- VAR_MATRIX3X4,
- VAR_MATRIX4,
- VAR_DOUBLE,
- VAR_STRINGVECTOR,
- VAR_RECT,
- VAR_INTVECTOR3,
- VAR_INT64,
- MAX_VAR_TYPES
- };
- /// Union for the possible variant values. Also stores non-POD objects such as String and math objects (excluding Matrix) which must not exceed 16 bytes in size (or 32 bytes in a 64-bit build.) Objects exceeding the limit are allocated on the heap and pointed to by _ptr.
- struct VariantValue
- {
- union
- {
- int int_;
- bool bool_;
- float float_;
- void* ptr_;
- };
- union
- {
- int int2_;
- float float2_;
- void* ptr2_;
- };
- union
- {
- int int3_;
- float float3_;
- void* ptr3_;
- };
- union
- {
- int int4_;
- float float4_;
- void* ptr4_;
- };
- };
- class Variant;
- class VectorBuffer;
- /// Vector of variants.
- typedef Vector<Variant> VariantVector;
- /// Vector of strings.
- typedef Vector<String> StringVector;
- /// Map of variants.
- typedef HashMap<StringHash, Variant> VariantMap;
- /// Typed resource reference.
- struct ATOMIC_API ResourceRef
- {
- /// Construct.
- ResourceRef()
- {
- }
- /// Construct with type only and empty id.
- ResourceRef(StringHash type) :
- type_(type)
- {
- }
- /// Construct with type and resource name.
- ResourceRef(StringHash type, const String& name) :
- type_(type),
- name_(name)
- {
- }
- /// Construct with type and resource name.
- ResourceRef(const String& type, const String& name) :
- type_(type),
- name_(name)
- {
- }
- /// Construct with type and resource name.
- ResourceRef(const char* type, const char* name) :
- type_(type),
- name_(name)
- {
- }
- /// Construct from another ResourceRef.
- ResourceRef(const ResourceRef& rhs) :
- type_(rhs.type_),
- name_(rhs.name_)
- {
- }
- /// Object type.
- StringHash type_;
- /// Object name.
- String name_;
- /// Test for equality with another reference.
- bool operator ==(const ResourceRef& rhs) const { return type_ == rhs.type_ && name_ == rhs.name_; }
- /// Test for inequality with another reference.
- bool operator !=(const ResourceRef& rhs) const { return type_ != rhs.type_ || name_ != rhs.name_; }
- };
- /// %List of typed resource references.
- struct ATOMIC_API ResourceRefList
- {
- /// Construct.
- ResourceRefList()
- {
- }
- /// Construct with type only.
- ResourceRefList(StringHash type) :
- type_(type)
- {
- }
- /// Construct with type and id list.
- ResourceRefList(StringHash type, const StringVector& names) :
- type_(type),
- names_(names)
- {
- }
- /// Object type.
- StringHash type_;
- /// List of object names.
- StringVector names_;
- /// Test for equality with another reference list.
- bool operator ==(const ResourceRefList& rhs) const { return type_ == rhs.type_ && names_ == rhs.names_; }
- /// Test for inequality with another reference list.
- bool operator !=(const ResourceRefList& rhs) const { return type_ != rhs.type_ || names_ != rhs.names_; }
- };
- /// Variable that supports a fixed set of types.
- class ATOMIC_API Variant
- {
- public:
- /// Construct empty.
- Variant() :
- type_(VAR_NONE)
- {
- }
- /// Construct from integer.
- Variant(int value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from 64 bit integer.
- Variant(long long value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from unsigned integer.
- Variant(unsigned value) :
- type_(VAR_NONE)
- {
- *this = (int)value;
- }
- /// Construct from unsigned integer.
- Variant(unsigned long long value) :
- type_(VAR_NONE)
- {
- *this = (long long)value;
- }
- /// Construct from a string hash (convert to integer).
- Variant(const StringHash& value) :
- type_(VAR_NONE)
- {
- *this = (int)value.Value();
- }
- /// Construct from a bool.
- Variant(bool value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from a float.
- Variant(float value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from a double.
- Variant(double value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from a Vector2.
- Variant(const Vector2& value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from a Vector3.
- Variant(const Vector3& value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from a Vector4.
- Variant(const Vector4& value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from a quaternion.
- Variant(const Quaternion& value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from a color.
- Variant(const Color& value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from a string.
- Variant(const String& value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from a C string.
- Variant(const char* value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from a buffer.
- Variant(const PODVector<unsigned char>& value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from a %VectorBuffer and store as a buffer.
- Variant(const VectorBuffer& value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from a pointer.
- Variant(void* value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from a resource reference.
- Variant(const ResourceRef& value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from a resource reference list.
- Variant(const ResourceRefList& value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from a variant vector.
- Variant(const VariantVector& value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from a variant map.
- Variant(const VariantMap& value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from a string vector.
- Variant(const StringVector& value) :
- type_ (VAR_NONE)
- {
- *this = value;
- }
- /// Construct from a rect.
- Variant(const Rect& value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from an integer rect.
- Variant(const IntRect& value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from an IntVector2.
- Variant(const IntVector2& value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from an IntVector3.
- Variant(const IntVector3& value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from a RefCounted pointer. The object will be stored internally in a WeakPtr so that its expiration can be detected safely.
- Variant(RefCounted* value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from a Matrix3.
- Variant(const Matrix3& value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from a Matrix3x4.
- Variant(const Matrix3x4& value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from a Matrix4.
- Variant(const Matrix4& value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Construct from type and value.
- Variant(const String& type, const String& value) :
- type_(VAR_NONE)
- {
- FromString(type, value);
- }
- /// Construct from type and value.
- Variant(VariantType type, const String& value) :
- type_(VAR_NONE)
- {
- FromString(type, value);
- }
- /// Construct from type and value.
- Variant(const char* type, const char* value) :
- type_(VAR_NONE)
- {
- FromString(type, value);
- }
- /// Construct from type and value.
- Variant(VariantType type, const char* value) :
- type_(VAR_NONE)
- {
- FromString(type, value);
- }
- /// Copy-construct from another variant.
- Variant(const Variant& value) :
- type_(VAR_NONE)
- {
- *this = value;
- }
- /// Destruct.
- ~Variant()
- {
- SetType(VAR_NONE);
- }
- /// Reset to empty.
- void Clear()
- {
- SetType(VAR_NONE);
- }
- /// Assign from another variant.
- Variant& operator =(const Variant& rhs);
- /// Assign from an integer.
- Variant& operator =(int rhs)
- {
- SetType(VAR_INT);
- value_.int_ = rhs;
- return *this;
- }
- /// Assign from 64 bit integer.
- Variant& operator =(long long rhs)
- {
- SetType(VAR_INT64);
- *reinterpret_cast<long long*>(&value_) = rhs;
- return *this;
- }
- /// Assign from unsigned 64 bit integer.
- Variant& operator =(unsigned long long rhs)
- {
- SetType(VAR_INT64);
- *reinterpret_cast<long long*>(&value_) = (long long)rhs;
- return *this;
- }
- /// Assign from an unsigned integer.
- Variant& operator =(unsigned rhs)
- {
- SetType(VAR_INT);
- value_.int_ = (int)rhs;
- return *this;
- }
- /// Assign from a StringHash (convert to integer.)
- Variant& operator =(const StringHash& rhs)
- {
- SetType(VAR_INT);
- value_.int_ = (int)rhs.Value();
- return *this;
- }
- /// Assign from a bool.
- Variant& operator =(bool rhs)
- {
- SetType(VAR_BOOL);
- value_.bool_ = rhs;
- return *this;
- }
- /// Assign from a float.
- Variant& operator =(float rhs)
- {
- SetType(VAR_FLOAT);
- value_.float_ = rhs;
- return *this;
- }
- /// Assign from a double.
- Variant& operator = (double rhs)
- {
- SetType(VAR_DOUBLE);
- *(reinterpret_cast<double*>(&value_)) = rhs;
- return *this;
- }
- /// Assign from a Vector2.
- Variant& operator =(const Vector2& rhs)
- {
- SetType(VAR_VECTOR2);
- *(reinterpret_cast<Vector2*>(&value_)) = rhs;
- return *this;
- }
- /// Assign from a Vector3.
- Variant& operator =(const Vector3& rhs)
- {
- SetType(VAR_VECTOR3);
- *(reinterpret_cast<Vector3*>(&value_)) = rhs;
- return *this;
- }
- /// Assign from a Vector4.
- Variant& operator =(const Vector4& rhs)
- {
- SetType(VAR_VECTOR4);
- *(reinterpret_cast<Vector4*>(&value_)) = rhs;
- return *this;
- }
- /// Assign from a quaternion.
- Variant& operator =(const Quaternion& rhs)
- {
- SetType(VAR_QUATERNION);
- *(reinterpret_cast<Quaternion*>(&value_)) = rhs;
- return *this;
- }
- /// Assign from a color.
- Variant& operator =(const Color& rhs)
- {
- SetType(VAR_COLOR);
- *(reinterpret_cast<Color*>(&value_)) = rhs;
- return *this;
- }
- /// Assign from a string.
- Variant& operator =(const String& rhs)
- {
- SetType(VAR_STRING);
- *(reinterpret_cast<String*>(&value_)) = rhs;
- return *this;
- }
- /// Assign from a C string.
- Variant& operator =(const char* rhs)
- {
- SetType(VAR_STRING);
- *(reinterpret_cast<String*>(&value_)) = String(rhs);
- return *this;
- }
- /// Assign from a buffer.
- Variant& operator =(const PODVector<unsigned char>& rhs)
- {
- SetType(VAR_BUFFER);
- *(reinterpret_cast<PODVector<unsigned char>*>(&value_)) = rhs;
- return *this;
- }
- /// Assign from a %VectorBuffer and store as a buffer.
- Variant& operator =(const VectorBuffer& rhs);
- /// Assign from a void pointer.
- Variant& operator =(void* rhs)
- {
- SetType(VAR_VOIDPTR);
- value_.ptr_ = rhs;
- return *this;
- }
- /// Assign from a resource reference.
- Variant& operator =(const ResourceRef& rhs)
- {
- SetType(VAR_RESOURCEREF);
- *(reinterpret_cast<ResourceRef*>(&value_)) = rhs;
- return *this;
- }
- /// Assign from a resource reference list.
- Variant& operator =(const ResourceRefList& rhs)
- {
- SetType(VAR_RESOURCEREFLIST);
- *(reinterpret_cast<ResourceRefList*>(&value_)) = rhs;
- return *this;
- }
- /// Assign from a variant vector.
- Variant& operator =(const VariantVector& rhs)
- {
- SetType(VAR_VARIANTVECTOR);
- *(reinterpret_cast<VariantVector*>(&value_)) = rhs;
- return *this;
- }
- /// Assign from a string vector.
- Variant& operator =(const StringVector& rhs)
- {
- SetType(VAR_STRINGVECTOR);
- *(reinterpret_cast<StringVector*>(&value_)) = rhs;
- return *this;
- }
- /// Assign from a variant map.
- Variant& operator =(const VariantMap& rhs)
- {
- SetType(VAR_VARIANTMAP);
- *(reinterpret_cast<VariantMap*>(&value_)) = rhs;
- return *this;
- }
- /// Assign from a rect.
- Variant& operator =(const Rect& rhs)
- {
- SetType(VAR_RECT);
- *(reinterpret_cast<Rect*>(&value_)) = rhs;
- return *this;
- }
- /// Assign from an integer rect.
- Variant& operator =(const IntRect& rhs)
- {
- SetType(VAR_INTRECT);
- *(reinterpret_cast<IntRect*>(&value_)) = rhs;
- return *this;
- }
- /// Assign from an IntVector2.
- Variant& operator =(const IntVector2& rhs)
- {
- SetType(VAR_INTVECTOR2);
- *(reinterpret_cast<IntVector2*>(&value_)) = rhs;
- return *this;
- }
- /// Assign from an IntVector3.
- Variant& operator =(const IntVector3& rhs)
- {
- SetType(VAR_INTVECTOR3);
- *(reinterpret_cast<IntVector3*>(&value_)) = rhs;
- return *this;
- }
- /// Assign from a RefCounted pointer. The object will be stored internally in a WeakPtr so that its expiration can be detected safely.
- Variant& operator =(RefCounted* rhs)
- {
- SetType(VAR_PTR);
- *(reinterpret_cast<WeakPtr<RefCounted>*>(&value_)) = rhs;
- return *this;
- }
- /// Assign from a Matrix3.
- Variant& operator =(const Matrix3& rhs)
- {
- SetType(VAR_MATRIX3);
- *(reinterpret_cast<Matrix3*>(value_.ptr_)) = rhs;
- return *this;
- }
- /// Assign from a Matrix3x4.
- Variant& operator =(const Matrix3x4& rhs)
- {
- SetType(VAR_MATRIX3X4);
- *(reinterpret_cast<Matrix3x4*>(value_.ptr_)) = rhs;
- return *this;
- }
- /// Assign from a Matrix4.
- Variant& operator =(const Matrix4& rhs)
- {
- SetType(VAR_MATRIX4);
- *(reinterpret_cast<Matrix4*>(value_.ptr_)) = rhs;
- return *this;
- }
- /// Test for equality with another variant.
- bool operator ==(const Variant& rhs) const;
- /// Test for equality with an integer. To return true, both the type and value must match.
- bool operator ==(int rhs) const { return type_ == VAR_INT ? value_.int_ == rhs : false; }
- /// Test for equality with an unsigned 64 bit integer. To return true, both the type and value must match.
- bool operator ==(unsigned rhs) const { return type_ == VAR_INT ? value_.int_ == (int)rhs : false; }
- /// Test for equality with an 64 bit integer. To return true, both the type and value must match.
- bool operator ==(long long rhs) const { return type_ == VAR_INT64 ? *reinterpret_cast<const long long*>(&value_.int_) == rhs : false; }
- /// Test for equality with an unsigned integer. To return true, both the type and value must match.
- bool operator ==(unsigned long long rhs) const { return type_ == VAR_INT64 ? *reinterpret_cast<const unsigned long long*>(&value_.int_) == (int)rhs : false; }
- /// Test for equality with a bool. To return true, both the type and value must match.
- bool operator ==(bool rhs) const { return type_ == VAR_BOOL ? value_.bool_ == rhs : false; }
- /// Test for equality with a float. To return true, both the type and value must match.
- bool operator ==(float rhs) const { return type_ == VAR_FLOAT ? value_.float_ == rhs : false; }
- /// Test for equality with a double. To return true, both the type and value must match.
- bool operator ==(double rhs) const { return type_ == VAR_DOUBLE ? *(reinterpret_cast<const double*>(&value_)) == rhs : false; }
- /// Test for equality with a Vector2. To return true, both the type and value must match.
- bool operator ==(const Vector2& rhs) const
- {
- return type_ == VAR_VECTOR2 ? *(reinterpret_cast<const Vector2*>(&value_)) == rhs : false;
- }
- /// Test for equality with a Vector3. To return true, both the type and value must match.
- bool operator ==(const Vector3& rhs) const
- {
- return type_ == VAR_VECTOR3 ? *(reinterpret_cast<const Vector3*>(&value_)) == rhs : false;
- }
- /// Test for equality with a Vector4. To return true, both the type and value must match.
- bool operator ==(const Vector4& rhs) const
- {
- return type_ == VAR_VECTOR4 ? *(reinterpret_cast<const Vector4*>(&value_)) == rhs : false;
- }
- /// Test for equality with a quaternion. To return true, both the type and value must match.
- bool operator ==(const Quaternion& rhs) const
- {
- return type_ == VAR_QUATERNION ? *(reinterpret_cast<const Quaternion*>(&value_)) == rhs : false;
- }
- /// Test for equality with a color. To return true, both the type and value must match.
- bool operator ==(const Color& rhs) const
- {
- return type_ == VAR_COLOR ? *(reinterpret_cast<const Color*>(&value_)) == rhs : false;
- }
- /// Test for equality with a string. To return true, both the type and value must match.
- bool operator ==(const String& rhs) const
- {
- return type_ == VAR_STRING ? *(reinterpret_cast<const String*>(&value_)) == rhs : false;
- }
- /// Test for equality with a buffer. To return true, both the type and value must match.
- bool operator ==(const PODVector<unsigned char>& rhs) const;
- /// Test for equality with a %VectorBuffer. To return true, both the type and value must match.
- bool operator ==(const VectorBuffer& rhs) const;
- /// Test for equality with a void pointer. To return true, both the type and value must match, with the exception that a RefCounted pointer is also allowed.
- bool operator ==(void* rhs) const
- {
- if (type_ == VAR_VOIDPTR)
- return value_.ptr_ == rhs;
- else if (type_ == VAR_PTR)
- return *(reinterpret_cast<const WeakPtr<RefCounted>*>(&value_)) == rhs;
- else
- return false;
- }
- /// Test for equality with a resource reference. To return true, both the type and value must match.
- bool operator ==(const ResourceRef& rhs) const
- {
- return type_ == VAR_RESOURCEREF ? *(reinterpret_cast<const ResourceRef*>(&value_)) == rhs : false;
- }
- /// Test for equality with a resource reference list. To return true, both the type and value must match.
- bool operator ==(const ResourceRefList& rhs) const
- {
- return type_ == VAR_RESOURCEREFLIST ? *(reinterpret_cast<const ResourceRefList*>(&value_)) == rhs : false;
- }
- /// Test for equality with a variant vector. To return true, both the type and value must match.
- bool operator ==(const VariantVector& rhs) const
- {
- return type_ == VAR_VARIANTVECTOR ? *(reinterpret_cast<const VariantVector*>(&value_)) == rhs : false;
- }
- /// Test for equality with a string vector. To return true, both the type and value must match.
- bool operator ==(const StringVector& rhs) const
- {
- return type_ == VAR_STRINGVECTOR ? *(reinterpret_cast<const StringVector*>(&value_)) == rhs : false;
- }
- /// Test for equality with a variant map. To return true, both the type and value must match.
- bool operator ==(const VariantMap& rhs) const
- {
- return type_ == VAR_VARIANTMAP ? *(reinterpret_cast<const VariantMap*>(&value_)) == rhs : false;
- }
- /// Test for equality with a rect. To return true, both the type and value must match.
- bool operator ==(const Rect& rhs) const
- {
- return type_ == VAR_RECT ? *(reinterpret_cast<const Rect*>(&value_)) == rhs : false;
- }
- /// Test for equality with an integer rect. To return true, both the type and value must match.
- bool operator ==(const IntRect& rhs) const
- {
- return type_ == VAR_INTRECT ? *(reinterpret_cast<const IntRect*>(&value_)) == rhs : false;
- }
- /// Test for equality with an IntVector2. To return true, both the type and value must match.
- bool operator ==(const IntVector2& rhs) const
- {
- return type_ == VAR_INTVECTOR2 ? *(reinterpret_cast<const IntVector2*>(&value_)) == rhs : false;
- }
- /// Test for equality with an IntVector3. To return true, both the type and value must match.
- bool operator ==(const IntVector3& rhs) const
- {
- return type_ == VAR_INTVECTOR3 ? *(reinterpret_cast<const IntVector3*>(&value_)) == rhs : false;
- }
- /// Test for equality with a StringHash. To return true, both the type and value must match.
- bool operator ==(const StringHash& rhs) const { return type_ == VAR_INT ? (unsigned)value_.int_ == rhs.Value() : false; }
- /// Test for equality with a RefCounted pointer. To return true, both the type and value must match, with the exception that void pointer is also allowed.
- bool operator ==(RefCounted* rhs) const
- {
- if (type_ == VAR_PTR)
- return *(reinterpret_cast<const WeakPtr<RefCounted>*>(&value_)) == rhs;
- else if (type_ == VAR_VOIDPTR)
- return value_.ptr_ == rhs;
- else
- return false;
- }
- /// Test for equality with a Matrix3. To return true, both the type and value must match.
- bool operator ==(const Matrix3& rhs) const
- {
- return type_ == VAR_MATRIX3 ? *(reinterpret_cast<const Matrix3*>(value_.ptr_)) == rhs : false;
- }
- /// Test for equality with a Matrix3x4. To return true, both the type and value must match.
- bool operator ==(const Matrix3x4& rhs) const
- {
- return type_ == VAR_MATRIX3X4 ? *(reinterpret_cast<const Matrix3x4*>(value_.ptr_)) == rhs : false;
- }
- /// Test for equality with a Matrix4. To return true, both the type and value must match.
- bool operator ==(const Matrix4& rhs) const
- {
- return type_ == VAR_MATRIX4 ? *(reinterpret_cast<const Matrix4*>(value_.ptr_)) == rhs : false;
- }
- /// Test for inequality with another variant.
- bool operator !=(const Variant& rhs) const { return !(*this == rhs); }
- /// Test for inequality with an integer.
- bool operator !=(int rhs) const { return !(*this == rhs); }
- /// Test for inequality with an unsigned integer.
- bool operator !=(unsigned rhs) const { return !(*this == rhs); }
- /// Test for inequality with an 64 bit integer.
- bool operator !=(long long rhs) const { return !(*this == rhs); }
- /// Test for inequality with an unsigned 64 bit integer.
- bool operator !=(unsigned long long rhs) const { return !(*this == rhs); }
- /// Test for inequality with a bool.
- bool operator !=(bool rhs) const { return !(*this == rhs); }
- /// Test for inequality with a float.
- bool operator !=(float rhs) const { return !(*this == rhs); }
- /// Test for inequality with a double.
- bool operator !=(double rhs) const { return !(*this == rhs); }
- /// Test for inequality with a Vector2.
- bool operator !=(const Vector2& rhs) const { return !(*this == rhs); }
- /// Test for inequality with a Vector3.
- bool operator !=(const Vector3& rhs) const { return !(*this == rhs); }
- /// Test for inequality with an Vector4.
- bool operator !=(const Vector4& rhs) const { return !(*this == rhs); }
- /// Test for inequality with a Quaternion.
- bool operator !=(const Quaternion& rhs) const { return !(*this == rhs); }
- /// Test for inequality with a string.
- bool operator !=(const String& rhs) const { return !(*this == rhs); }
- /// Test for inequality with a buffer.
- bool operator !=(const PODVector<unsigned char>& rhs) const { return !(*this == rhs); }
- /// Test for inequality with a %VectorBuffer.
- bool operator !=(const VectorBuffer& rhs) const { return !(*this == rhs); }
- /// Test for inequality with a pointer.
- bool operator !=(void* rhs) const { return !(*this == rhs); }
- /// Test for inequality with a resource reference.
- bool operator !=(const ResourceRef& rhs) const { return !(*this == rhs); }
- /// Test for inequality with a resource reference list.
- bool operator !=(const ResourceRefList& rhs) const { return !(*this == rhs); }
- /// Test for inequality with a variant vector.
- bool operator !=(const VariantVector& rhs) const { return !(*this == rhs); }
- /// Test for inequality with a string vector.
- bool operator !=(const StringVector& rhs) const { return !(*this == rhs); }
- /// Test for inequality with a variant map.
- bool operator !=(const VariantMap& rhs) const { return !(*this == rhs); }
- /// Test for inequality with a rect.
- bool operator !=(const Rect& rhs) const { return !(*this == rhs); }
- /// Test for inequality with an integer rect.
- bool operator !=(const IntRect& rhs) const { return !(*this == rhs); }
- /// Test for inequality with an IntVector2.
- bool operator !=(const IntVector2& rhs) const { return !(*this == rhs); }
- /// Test for inequality with an IntVector3.
- bool operator !=(const IntVector3& rhs) const { return !(*this == rhs); }
- /// Test for inequality with a StringHash.
- bool operator !=(const StringHash& rhs) const { return !(*this == rhs); }
- /// Test for inequality with a RefCounted pointer.
- bool operator !=(RefCounted* rhs) const { return !(*this == rhs); }
- /// Test for inequality with a Matrix3.
- bool operator !=(const Matrix3& rhs) const { return !(*this == rhs); }
- /// Test for inequality with a Matrix3x4.
- bool operator !=(const Matrix3x4& rhs) const { return !(*this == rhs); }
- /// Test for inequality with a Matrix4.
- bool operator !=(const Matrix4& rhs) const { return !(*this == rhs); }
- /// Set from typename and value strings. Pointers will be set to null, and VariantBuffer or VariantMap types are not supported.
- void FromString(const String& type, const String& value);
- /// Set from typename and value strings. Pointers will be set to null, and VariantBuffer or VariantMap types are not supported.
- void FromString(const char* type, const char* value);
- /// Set from type and value string. Pointers will be set to null, and VariantBuffer or VariantMap types are not supported.
- void FromString(VariantType type, const String& value);
- /// Set from type and value string. Pointers will be set to null, and VariantBuffer or VariantMap types are not supported.
- void FromString(VariantType type, const char* value);
- /// Set buffer type from a memory area.
- void SetBuffer(const void* data, unsigned size);
- /// Return int or zero on type mismatch. Floats and doubles are converted.
- int GetInt() const
- {
- if (type_ == VAR_INT)
- return value_.int_;
- else if (type_ == VAR_FLOAT)
- return (int)value_.float_;
- else if (type_ == VAR_DOUBLE)
- return (int)*reinterpret_cast<const double*>(&value_);
- else
- return 0;
- }
- /// Return 64 bit int or zero on type mismatch. Floats and doubles are converted.
- long long GetInt64() const
- {
- if (type_ == VAR_INT64)
- return *(reinterpret_cast<const long long*>(&value_));
- else if (type_ == VAR_INT)
- return value_.int_;
- else if (type_ == VAR_FLOAT)
- return (long long)value_.float_;
- else if (type_ == VAR_DOUBLE)
- return (long long)*reinterpret_cast<const double*>(&value_);
- else
- return 0;
- }
- /// Return unsigned 64 bit int or zero on type mismatch. Floats and doubles are converted.
- unsigned long long GetUInt64() const
- {
- if (type_ == VAR_INT64)
- return *(reinterpret_cast<const unsigned long long*>(&value_));
- else if (type_ == VAR_INT)
- return static_cast<unsigned long long>(value_.int_);
- else if (type_ == VAR_FLOAT)
- return (unsigned long long)value_.float_;
- else if (type_ == VAR_DOUBLE)
- return (unsigned long long)*reinterpret_cast<const double*>(&value_);
- else
- return 0;
- }
- /// Return unsigned int or zero on type mismatch. Floats and doubles are converted.
- unsigned GetUInt() const
- {
- if (type_ == VAR_INT)
- return (unsigned)value_.int_;
- else if (type_ == VAR_FLOAT)
- return (unsigned)value_.float_;
- else if (type_ == VAR_DOUBLE)
- return (unsigned)*reinterpret_cast<const double*>(&value_);
- else
- return 0;
- }
- /// Return StringHash or zero on type mismatch.
- StringHash GetStringHash() const { return StringHash(GetUInt()); }
- /// Return bool or false on type mismatch.
- bool GetBool() const { return type_ == VAR_BOOL ? value_.bool_ : false; }
- /// Return float or zero on type mismatch. Ints and doubles are converted.
- float GetFloat() const
- {
- if (type_ == VAR_FLOAT)
- return value_.float_;
- else if (type_ == VAR_DOUBLE)
- return (float)*reinterpret_cast<const double*>(&value_);
- else if (type_ == VAR_INT)
- return (float)value_.int_;
- else
- return 0.0f;
- }
- /// Return double or zero on type mismatch. Ints and floats are converted.
- double GetDouble() const
- {
- if (type_ == VAR_DOUBLE)
- return *reinterpret_cast<const double*>(&value_);
- else if (type_ == VAR_FLOAT)
- return (double)value_.float_;
- else if (type_ == VAR_INT)
- return (double)value_.int_;
- else
- return 0.0;
- }
- /// Return Vector2 or zero on type mismatch.
- const Vector2& GetVector2() const { return type_ == VAR_VECTOR2 ? *reinterpret_cast<const Vector2*>(&value_) : Vector2::ZERO; }
- /// Return Vector3 or zero on type mismatch.
- const Vector3& GetVector3() const { return type_ == VAR_VECTOR3 ? *reinterpret_cast<const Vector3*>(&value_) : Vector3::ZERO; }
- /// Return Vector4 or zero on type mismatch.
- const Vector4& GetVector4() const { return type_ == VAR_VECTOR4 ? *reinterpret_cast<const Vector4*>(&value_) : Vector4::ZERO; }
- /// Return quaternion or identity on type mismatch.
- const Quaternion& GetQuaternion() const
- {
- return type_ == VAR_QUATERNION ? *reinterpret_cast<const Quaternion*>(&value_) : Quaternion::IDENTITY;
- }
- /// Return color or default on type mismatch. Vector4 is aliased to Color if necessary.
- const Color& GetColor() const { return (type_ == VAR_COLOR || type_ == VAR_VECTOR4) ? *reinterpret_cast<const Color*>(&value_) : Color::WHITE; }
- /// Return string or empty on type mismatch.
- const String& GetString() const { return type_ == VAR_STRING ? *reinterpret_cast<const String*>(&value_) : String::EMPTY; }
- /// Return buffer or empty on type mismatch.
- const PODVector<unsigned char>& GetBuffer() const
- {
- return type_ == VAR_BUFFER ? *reinterpret_cast<const PODVector<unsigned char>*>(&value_) : emptyBuffer;
- }
- /// Return %VectorBuffer containing the buffer or empty on type mismatch.
- VectorBuffer GetVectorBuffer() const;
- /// Return void pointer or null on type mismatch. RefCounted pointer will be converted.
- void* GetVoidPtr() const
- {
- if (type_ == VAR_VOIDPTR)
- return value_.ptr_;
- else if (type_ == VAR_PTR)
- return *reinterpret_cast<const WeakPtr<RefCounted>*>(&value_);
- else
- return 0;
- }
- /// Return a resource reference or empty on type mismatch.
- const ResourceRef& GetResourceRef() const
- {
- return type_ == VAR_RESOURCEREF ? *reinterpret_cast<const ResourceRef*>(&value_) : emptyResourceRef;
- }
- /// Return a resource reference list or empty on type mismatch.
- const ResourceRefList& GetResourceRefList() const
- {
- return type_ == VAR_RESOURCEREFLIST ? *reinterpret_cast<const ResourceRefList*>(&value_) : emptyResourceRefList;
- }
- /// Return a variant vector or empty on type mismatch.
- const VariantVector& GetVariantVector() const
- {
- return type_ == VAR_VARIANTVECTOR ? *reinterpret_cast<const VariantVector*>(&value_) : emptyVariantVector;
- }
- /// Return a string vector or empty on type mismatch.
- const StringVector& GetStringVector() const
- {
- return type_ == VAR_STRINGVECTOR ? *reinterpret_cast<const StringVector*>(&value_) : emptyStringVector;
- }
- /// Return a variant map or empty on type mismatch.
- const VariantMap& GetVariantMap() const
- {
- return type_ == VAR_VARIANTMAP ? *reinterpret_cast<const VariantMap*>(&value_) : emptyVariantMap;
- }
- /// Return a rect or empty on type mismatch.
- const Rect& GetRect() const { return type_ == VAR_RECT ? *reinterpret_cast<const Rect*>(&value_) : Rect::ZERO; }
- /// Return an integer rect or empty on type mismatch.
- const IntRect& GetIntRect() const { return type_ == VAR_INTRECT ? *reinterpret_cast<const IntRect*>(&value_) : IntRect::ZERO; }
- /// Return an IntVector2 or empty on type mismatch.
- const IntVector2& GetIntVector2() const
- {
- return type_ == VAR_INTVECTOR2 ? *reinterpret_cast<const IntVector2*>(&value_) : IntVector2::ZERO;
- }
- /// Return an IntVector3 or empty on type mismatch.
- const IntVector3& GetIntVector3() const
- {
- return type_ == VAR_INTVECTOR3 ? *reinterpret_cast<const IntVector3*>(&value_) : IntVector3::ZERO;
- }
- /// Return a RefCounted pointer or null on type mismatch. Will return null if holding a void pointer, as it can not be safely verified that the object is a RefCounted.
- RefCounted* GetPtr() const
- {
- return type_ == VAR_PTR ? *reinterpret_cast<const WeakPtr<RefCounted>*>(&value_) : (RefCounted*)0;
- }
- /// Return a Matrix3 or identity on type mismatch.
- const Matrix3& GetMatrix3() const
- {
- return type_ == VAR_MATRIX3 ? *(reinterpret_cast<const Matrix3*>(value_.ptr_)) : Matrix3::IDENTITY;
- }
- /// Return a Matrix3x4 or identity on type mismatch.
- const Matrix3x4& GetMatrix3x4() const
- {
- return type_ == VAR_MATRIX3X4 ? *(reinterpret_cast<const Matrix3x4*>(value_.ptr_)) : Matrix3x4::IDENTITY;
- }
- /// Return a Matrix4 or identity on type mismatch.
- const Matrix4& GetMatrix4() const
- {
- return type_ == VAR_MATRIX4 ? *(reinterpret_cast<const Matrix4*>(value_.ptr_)) : Matrix4::IDENTITY;
- }
- /// Return value's type.
- VariantType GetType() const { return type_; }
- /// Return value's type name.
- String GetTypeName() const;
- /// Convert value to string. Pointers are returned as null, and VariantBuffer or VariantMap are not supported and return empty.
- String ToString() const;
- /// Return true when the variant value is considered zero according to its actual type.
- bool IsZero() const;
- /// Return true when the variant is empty (i.e. not initialized yet).
- bool IsEmpty() const { return type_ == VAR_NONE; }
- /// Return the value, template version.
- template <class T> T Get() const;
- /// Return a pointer to a modifiable buffer or null on type mismatch.
- PODVector<unsigned char>* GetBufferPtr()
- {
- return type_ == VAR_BUFFER ? reinterpret_cast<PODVector<unsigned char>*>(&value_) : 0;
- }
- /// Return a pointer to a modifiable variant vector or null on type mismatch.
- VariantVector* GetVariantVectorPtr() { return type_ == VAR_VARIANTVECTOR ? reinterpret_cast<VariantVector*>(&value_) : 0; }
- /// Return a pointer to a modifiable string vector or null on type mismatch.
- StringVector* GetStringVectorPtr() { return type_ == VAR_STRINGVECTOR ? reinterpret_cast<StringVector*>(&value_) : 0; }
- /// Return a pointer to a modifiable variant map or null on type mismatch.
- VariantMap* GetVariantMapPtr() { return type_ == VAR_VARIANTMAP ? reinterpret_cast<VariantMap*>(&value_) : 0; }
- /// Return name for variant type.
- static String GetTypeName(VariantType type);
- /// Return variant type from type name.
- static VariantType GetTypeFromName(const String& typeName);
- /// Return variant type from type name.
- static VariantType GetTypeFromName(const char* typeName);
- /// Empty variant.
- static const Variant EMPTY;
- /// Empty buffer.
- static const PODVector<unsigned char> emptyBuffer;
- /// Empty resource reference.
- static const ResourceRef emptyResourceRef;
- /// Empty resource reference list.
- static const ResourceRefList emptyResourceRefList;
- /// Empty variant map.
- static const VariantMap emptyVariantMap;
- /// Empty variant vector.
- static const VariantVector emptyVariantVector;
- /// Empty string vector.
- static const StringVector emptyStringVector;
- private:
- /// Set new type and allocate/deallocate memory as necessary.
- void SetType(VariantType newType);
- /// Variant type.
- VariantType type_;
- /// Variant value.
- VariantValue value_;
- };
- /// Return variant type from type.
- template <typename T> VariantType GetVariantType();
- // Return variant type from concrete types
- template <> inline VariantType GetVariantType<int>() { return VAR_INT; }
- template <> inline VariantType GetVariantType<unsigned>() { return VAR_INT; }
- template <> inline VariantType GetVariantType<long long>() { return VAR_INT64; }
- template <> inline VariantType GetVariantType<unsigned long long>() { return VAR_INT64; }
- template <> inline VariantType GetVariantType<bool>() { return VAR_BOOL; }
- template <> inline VariantType GetVariantType<float>() { return VAR_FLOAT; }
- template <> inline VariantType GetVariantType<double>() { return VAR_DOUBLE; }
- template <> inline VariantType GetVariantType<Vector2>() { return VAR_VECTOR2; }
- template <> inline VariantType GetVariantType<Vector3>() { return VAR_VECTOR3; }
- template <> inline VariantType GetVariantType<Vector4>() { return VAR_VECTOR4; }
- template <> inline VariantType GetVariantType<Quaternion>() { return VAR_QUATERNION; }
- template <> inline VariantType GetVariantType<Color>() { return VAR_COLOR; }
- template <> inline VariantType GetVariantType<String>() { return VAR_STRING; }
- template <> inline VariantType GetVariantType<StringHash>() { return VAR_INT; }
- template <> inline VariantType GetVariantType<PODVector<unsigned char> >() { return VAR_BUFFER; }
- template <> inline VariantType GetVariantType<ResourceRef>() { return VAR_RESOURCEREF; }
- template <> inline VariantType GetVariantType<ResourceRefList>() { return VAR_RESOURCEREFLIST; }
- template <> inline VariantType GetVariantType<VariantVector>() { return VAR_VARIANTVECTOR; }
- template <> inline VariantType GetVariantType<StringVector>() { return VAR_STRINGVECTOR; }
- template <> inline VariantType GetVariantType<VariantMap>() { return VAR_VARIANTMAP; }
- template <> inline VariantType GetVariantType<Rect>() { return VAR_RECT; }
- template <> inline VariantType GetVariantType<IntRect>() { return VAR_INTRECT; }
- template <> inline VariantType GetVariantType<IntVector2>() { return VAR_INTVECTOR2; }
- template <> inline VariantType GetVariantType<IntVector3>() { return VAR_INTVECTOR3; }
- template <> inline VariantType GetVariantType<Matrix3>() { return VAR_MATRIX3; }
- template <> inline VariantType GetVariantType<Matrix3x4>() { return VAR_MATRIX3X4; }
- template <> inline VariantType GetVariantType<Matrix4>() { return VAR_MATRIX4; }
- // Specializations of Variant::Get<T>
- template <> ATOMIC_API int Variant::Get<int>() const;
- template <> ATOMIC_API unsigned Variant::Get<unsigned>() const;
- template <> ATOMIC_API long long Variant::Get<long long>() const;
- template <> ATOMIC_API unsigned long long Variant::Get<unsigned long long>() const;
- template <> ATOMIC_API StringHash Variant::Get<StringHash>() const;
- template <> ATOMIC_API bool Variant::Get<bool>() const;
- template <> ATOMIC_API float Variant::Get<float>() const;
- template <> ATOMIC_API double Variant::Get<double>() const;
- template <> ATOMIC_API const Vector2& Variant::Get<const Vector2&>() const;
- template <> ATOMIC_API const Vector3& Variant::Get<const Vector3&>() const;
- template <> ATOMIC_API const Vector4& Variant::Get<const Vector4&>() const;
- template <> ATOMIC_API const Quaternion& Variant::Get<const Quaternion&>() const;
- template <> ATOMIC_API const Color& Variant::Get<const Color&>() const;
- template <> ATOMIC_API const String& Variant::Get<const String&>() const;
- template <> ATOMIC_API const Rect& Variant::Get<const Rect&>() const;
- template <> ATOMIC_API const IntRect& Variant::Get<const IntRect&>() const;
- template <> ATOMIC_API const IntVector2& Variant::Get<const IntVector2&>() const;
- template <> ATOMIC_API const IntVector3& Variant::Get<const IntVector3&>() const;
- template <> ATOMIC_API const PODVector<unsigned char>& Variant::Get<const PODVector<unsigned char>&>() const;
- template <> ATOMIC_API void* Variant::Get<void*>() const;
- template <> ATOMIC_API RefCounted* Variant::Get<RefCounted*>() const;
- template <> ATOMIC_API const Matrix3& Variant::Get<const Matrix3&>() const;
- template <> ATOMIC_API const Matrix3x4& Variant::Get<const Matrix3x4&>() const;
- template <> ATOMIC_API const Matrix4& Variant::Get<const Matrix4&>() const;
- template <> ATOMIC_API ResourceRef Variant::Get<ResourceRef>() const;
- template <> ATOMIC_API ResourceRefList Variant::Get<ResourceRefList>() const;
- template <> ATOMIC_API VariantVector Variant::Get<VariantVector>() const;
- template <> ATOMIC_API StringVector Variant::Get<StringVector>() const;
- template <> ATOMIC_API VariantMap Variant::Get<VariantMap>() const;
- template <> ATOMIC_API Vector2 Variant::Get<Vector2>() const;
- template <> ATOMIC_API Vector3 Variant::Get<Vector3>() const;
- template <> ATOMIC_API Vector4 Variant::Get<Vector4>() const;
- template <> ATOMIC_API Quaternion Variant::Get<Quaternion>() const;
- template <> ATOMIC_API Color Variant::Get<Color>() const;
- template <> ATOMIC_API String Variant::Get<String>() const;
- template <> ATOMIC_API Rect Variant::Get<Rect>() const;
- template <> ATOMIC_API IntRect Variant::Get<IntRect>() const;
- template <> ATOMIC_API IntVector2 Variant::Get<IntVector2>() const;
- template <> ATOMIC_API IntVector3 Variant::Get<IntVector3>() const;
- template <> ATOMIC_API PODVector<unsigned char> Variant::Get<PODVector<unsigned char> >() const;
- template <> ATOMIC_API Matrix3 Variant::Get<Matrix3>() const;
- template <> ATOMIC_API Matrix3x4 Variant::Get<Matrix3x4>() const;
- template <> ATOMIC_API Matrix4 Variant::Get<Matrix4>() const;
- }
|