|
@@ -12,6 +12,15 @@ namespace BansheeEngine
|
|
|
struct BS_UTILITY_EXPORT SerializedInstance : IReflectable
|
|
struct BS_UTILITY_EXPORT SerializedInstance : IReflectable
|
|
|
{
|
|
{
|
|
|
virtual ~SerializedInstance() { }
|
|
virtual ~SerializedInstance() { }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @brief Performs a deep clone of this object any any potential child objects.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param cloneData If true the data contained by the objects will be cloned as well, instead of
|
|
|
|
|
+ * just meta-data. If false then both the original and the cloned instances
|
|
|
|
|
+ * will point to the same instances of data. The original will retain data ownership
|
|
|
|
|
+ * and it will go out of scope when the original does.
|
|
|
|
|
+ */
|
|
|
virtual SPtr<SerializedInstance> clone(bool cloneData = true) = 0;
|
|
virtual SPtr<SerializedInstance> clone(bool cloneData = true) = 0;
|
|
|
|
|
|
|
|
/************************************************************************/
|
|
/************************************************************************/
|
|
@@ -24,8 +33,7 @@ namespace BansheeEngine
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @brief A single serialized entry representing a
|
|
|
|
|
- * and its value in an object.
|
|
|
|
|
|
|
+ * @brief An intermediate serialized data for a single field in an object.
|
|
|
*/
|
|
*/
|
|
|
struct BS_UTILITY_EXPORT SerializedEntry : IReflectable
|
|
struct BS_UTILITY_EXPORT SerializedEntry : IReflectable
|
|
|
{
|
|
{
|
|
@@ -67,8 +75,8 @@ namespace BansheeEngine
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @brief A serialized portion of an object consisting of multiple entries,
|
|
|
|
|
- * one for each field.
|
|
|
|
|
|
|
+ * @brief A serialized portion of an object belonging to a specific class in a class hierarchy.
|
|
|
|
|
+ * Consists of multiple entries, one for each field.
|
|
|
*/
|
|
*/
|
|
|
struct BS_UTILITY_EXPORT SerializedSubObject : IReflectable
|
|
struct BS_UTILITY_EXPORT SerializedSubObject : IReflectable
|
|
|
{
|
|
{
|
|
@@ -94,7 +102,14 @@ namespace BansheeEngine
|
|
|
*/
|
|
*/
|
|
|
struct BS_UTILITY_EXPORT SerializedObject : SerializedInstance
|
|
struct BS_UTILITY_EXPORT SerializedObject : SerializedInstance
|
|
|
{
|
|
{
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @brief Returns the RTTI type ID for the most-derived class of this object.
|
|
|
|
|
+ */
|
|
|
UINT32 getRootTypeId() const { return subObjects[0].typeId; }
|
|
UINT32 getRootTypeId() const { return subObjects[0].typeId; }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @copydoc SerializedInstance::clone
|
|
|
|
|
+ */
|
|
|
SPtr<SerializedInstance> clone(bool cloneData = true) override;
|
|
SPtr<SerializedInstance> clone(bool cloneData = true) override;
|
|
|
|
|
|
|
|
Vector<SerializedSubObject> subObjects;
|
|
Vector<SerializedSubObject> subObjects;
|
|
@@ -109,7 +124,7 @@ namespace BansheeEngine
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @brief Contains a pointer to the serialized value of a specific
|
|
|
|
|
|
|
+ * @brief Contains data for a serialized value of a specific
|
|
|
* field or array entry.
|
|
* field or array entry.
|
|
|
*/
|
|
*/
|
|
|
struct BS_UTILITY_EXPORT SerializedField : SerializedInstance
|
|
struct BS_UTILITY_EXPORT SerializedField : SerializedInstance
|
|
@@ -126,6 +141,9 @@ namespace BansheeEngine
|
|
|
bs_free(value);
|
|
bs_free(value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @copydoc SerializedInstance::clone
|
|
|
|
|
+ */
|
|
|
SPtr<SerializedInstance> clone(bool cloneData = true) override;
|
|
SPtr<SerializedInstance> clone(bool cloneData = true) override;
|
|
|
|
|
|
|
|
UINT8* value;
|
|
UINT8* value;
|
|
@@ -150,6 +168,9 @@ namespace BansheeEngine
|
|
|
:numElements(0)
|
|
:numElements(0)
|
|
|
{ }
|
|
{ }
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @copydoc SerializedInstance::clone
|
|
|
|
|
+ */
|
|
|
SPtr<SerializedInstance> clone(bool cloneData = true) override;
|
|
SPtr<SerializedInstance> clone(bool cloneData = true) override;
|
|
|
|
|
|
|
|
UnorderedMap<UINT32, SerializedArrayEntry> entries;
|
|
UnorderedMap<UINT32, SerializedArrayEntry> entries;
|