Index: src/ch/TBasePathData.h =================================================================== diff -u -N -ra77ea347e3787d330b37917be4c72be480419c93 -r5fd6beaad9f1eccb664b997d151acb59961e4827 --- src/ch/TBasePathData.h (.../TBasePathData.h) (revision a77ea347e3787d330b37917be4c72be480419c93) +++ src/ch/TBasePathData.h (.../TBasePathData.h) (revision 5fd6beaad9f1eccb664b997d151acb59961e4827) @@ -48,14 +48,8 @@ chcore::TSmartPath GetDestinationPath() const; bool IsDestinationPathSet() const { return !m_pathDst.IsEmpty(); } - template - void Serialize(Archive& ar, unsigned int /*uiVersion*/, bool bData) - { - if(bData) - ar & m_bMove; - else - ar & m_pathDst; - } + void Serialize(chcore::TReadBinarySerializer& rSerializer, bool bData); + void Serialize(chcore::TWriteBinarySerializer& rSerializer, bool bData); private: bool m_bMove; // specifies if we can use MoveFile (if will be moved) @@ -89,12 +83,9 @@ void Clear(); // serialization - template - void Store(Archive& ar, unsigned int /*uiVersion*/, bool bData) const; + void Serialize(chcore::TReadBinarySerializer& rSerializer, bool bData); + void Serialize(chcore::TWriteBinarySerializer& rSerializer, bool bData); - template - void Load(Archive& ar, unsigned int /*uiVersion*/, bool bData); - private: TBasePathDataContainer(const TBasePathDataContainer& rSrc); TBasePathDataContainer& operator=(const TBasePathDataContainer& rSrc); @@ -106,49 +97,4 @@ mutable boost::shared_mutex m_lock; }; -template -void TBasePathDataContainer::Store(Archive& ar, unsigned int /*uiVersion*/, bool bData) const -{ - boost::shared_lock lock(m_lock); - // write data - size_t stCount = m_vEntries.size(); - ar << stCount; - - BOOST_FOREACH(const TBasePathDataPtr& spEntry, m_vEntries) - { - spEntry->Serialize(ar, 0, bData); - } -} - -template -void TBasePathDataContainer::Load(Archive& ar, unsigned int /*uiVersion*/, bool bData) -{ - size_t stCount; - ar >> stCount; - - boost::unique_lock lock(m_lock); - - if(!bData && m_vEntries.size() != stCount) - THROW(_T("Count of entries with data differs from the count of state entries"), 0, 0, 0); - - if(bData) - { - m_vEntries.clear(); - m_vEntries.reserve(stCount); - } - - TBasePathDataPtr spEntry; - for(size_t stIndex = 0; stIndex < stCount; ++stIndex) - { - if(bData) - spEntry.reset(new TBasePathData); - else - spEntry = m_vEntries.at(stIndex); - spEntry->Serialize(ar, 0, bData); - - if(bData) - m_vEntries.push_back(spEntry); - } -} - #endif // __TBASEPATHDATA_H__