--- libgig/trunk/src/Serialization.h 2020/05/19 14:28:20 3773 +++ libgig/trunk/src/Serialization.h 2020/05/19 14:55:48 3774 @@ -725,6 +725,14 @@ */ class Archive { public: + /** @brief Current activity of @c Archive object. + */ + enum operation_t { + OPERATION_NONE, ///< Archive is currently neither serializing, nor deserializing. + OPERATION_SERIALIZE, ///< Archive is currently serializing. + OPERATION_DESERIALIZE ///< Archive is currently deserializing. + }; + Archive(); Archive(const RawData& data); Archive(const uint8_t* data, size_t size); @@ -793,11 +801,11 @@ template void deserialize(T* obj) { Archive a; - m_operation = OPERATION_DESERIALIZE; + a.m_operation = m_operation = OPERATION_DESERIALIZE; obj->serialize(&a); a.m_root = UID::from(obj); Syncer s(a, *this); - m_operation = OPERATION_NONE; + a.m_operation = m_operation = OPERATION_NONE; } /** @brief Initiate serialization of your C++ objects. @@ -1068,6 +1076,7 @@ time_t timeStampModified() const; tm dateTimeCreated(time_base_t base = LOCAL_TIME) const; tm dateTimeModified(time_base_t base = LOCAL_TIME) const; + operation_t operation() const; protected: // UID resolver for non-pointer types @@ -1185,12 +1194,6 @@ Archive& m_src; }; - enum operation_t { - OPERATION_NONE, - OPERATION_SERIALIZE, - OPERATION_DESERIALIZE - }; - virtual void encode(); ObjectPool m_allObjects;