/[svn]/libgig/trunk/src/Serialization.h
ViewVC logotype

Diff of /libgig/trunk/src/Serialization.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3773 by schoenebeck, Tue May 19 14:28:20 2020 UTC revision 3774 by schoenebeck, Tue May 19 14:55:48 2020 UTC
# Line 725  namespace Serialization { Line 725  namespace Serialization {
725       */       */
726      class Archive {      class Archive {
727      public:      public:
728            /** @brief Current activity of @c Archive object.
729             */
730            enum operation_t {
731                OPERATION_NONE,        ///< Archive is currently neither serializing, nor deserializing.
732                OPERATION_SERIALIZE,   ///< Archive is currently serializing.
733                OPERATION_DESERIALIZE  ///< Archive is currently deserializing.
734            };
735    
736          Archive();          Archive();
737          Archive(const RawData& data);          Archive(const RawData& data);
738          Archive(const uint8_t* data, size_t size);          Archive(const uint8_t* data, size_t size);
# Line 793  namespace Serialization { Line 801  namespace Serialization {
801          template<typename T>          template<typename T>
802          void deserialize(T* obj) {          void deserialize(T* obj) {
803              Archive a;              Archive a;
804              m_operation = OPERATION_DESERIALIZE;              a.m_operation = m_operation = OPERATION_DESERIALIZE;
805              obj->serialize(&a);              obj->serialize(&a);
806              a.m_root = UID::from(obj);              a.m_root = UID::from(obj);
807              Syncer s(a, *this);              Syncer s(a, *this);
808              m_operation = OPERATION_NONE;              a.m_operation = m_operation = OPERATION_NONE;
809          }          }
810    
811          /** @brief Initiate serialization of your C++ objects.          /** @brief Initiate serialization of your C++ objects.
# Line 1068  namespace Serialization { Line 1076  namespace Serialization {
1076          time_t timeStampModified() const;          time_t timeStampModified() const;
1077          tm dateTimeCreated(time_base_t base = LOCAL_TIME) const;          tm dateTimeCreated(time_base_t base = LOCAL_TIME) const;
1078          tm dateTimeModified(time_base_t base = LOCAL_TIME) const;          tm dateTimeModified(time_base_t base = LOCAL_TIME) const;
1079            operation_t operation() const;
1080    
1081      protected:      protected:
1082          // UID resolver for non-pointer types          // UID resolver for non-pointer types
# Line 1185  namespace Serialization { Line 1194  namespace Serialization {
1194              Archive& m_src;              Archive& m_src;
1195          };          };
1196    
         enum operation_t {  
             OPERATION_NONE,  
             OPERATION_SERIALIZE,  
             OPERATION_DESERIALIZE  
         };  
   
1197          virtual void encode();          virtual void encode();
1198    
1199          ObjectPool m_allObjects;          ObjectPool m_allObjects;

Legend:
Removed from v.3773  
changed lines
  Added in v.3774

  ViewVC Help
Powered by ViewVC