Index: src/libchcore/TSQLiteSerializerRowData.cpp =================================================================== diff -u -r320c4eb6ba3a38dcd6fbda6a9a12a8350a153e41 -r19925be73ffcadd9f345f10e03e55aadb3f0eeac --- src/libchcore/TSQLiteSerializerRowData.cpp (.../TSQLiteSerializerRowData.cpp) (revision 320c4eb6ba3a38dcd6fbda6a9a12a8350a153e41) +++ src/libchcore/TSQLiteSerializerRowData.cpp (.../TSQLiteSerializerRowData.cpp) (revision 19925be73ffcadd9f345f10e03e55aadb3f0eeac) @@ -38,61 +38,73 @@ void operator()(bool value) const { + ATLTRACE(_T("- param(bool): %ld\n"), value ? 1l : 0l); m_rStatement.BindValue(m_rColumn++, value); } void operator()(short value) const { + ATLTRACE(_T("- param(short): %d\n"), value); m_rStatement.BindValue(m_rColumn++, value); } void operator()(unsigned short value) const { + ATLTRACE(_T("- param(ushort): %u\n"), value); m_rStatement.BindValue(m_rColumn++, value); } void operator()(int value) const { + ATLTRACE(_T("- param(int): %ld\n"), value); m_rStatement.BindValue(m_rColumn++, value); } void operator()(unsigned int value) const { + ATLTRACE(_T("- param(uint): %lu\n"), value); m_rStatement.BindValue(m_rColumn++, value); } void operator()(long value) const { + ATLTRACE(_T("- param(long): %ld\n"), value); m_rStatement.BindValue(m_rColumn++, value); } void operator()(unsigned long value) const { + ATLTRACE(_T("- param(ulong): %lu\n"), value); m_rStatement.BindValue(m_rColumn++, value); } void operator()(long long value) const { + ATLTRACE(_T("- param(longlong): %I64d\n"), value); m_rStatement.BindValue(m_rColumn++, value); } void operator()(unsigned long long value) const { + ATLTRACE(_T("- param(ulonglong): %I64u\n"), value); m_rStatement.BindValue(m_rColumn++, value); } void operator()(double value) const { + ATLTRACE(_T("- param(double): %f\n"), value); m_rStatement.BindValue(m_rColumn++, value); } void operator()(const TString& value) const { + ATLTRACE(_T("- param(string): '%s'\n"), (PCTSTR)value); m_rStatement.BindValue(m_rColumn++, value); } void operator()(const TSmartPath& value) const { + ATLTRACE(_T("- param(path): %s\n"), value.ToString()); m_rStatement.BindValue(m_rColumn++, value); } @@ -173,7 +185,7 @@ ATLTRACE(_T("Executing query: %s\n"), (PCTSTR)strQuery); tStatement.Step(); } - else + else if(!m_mapValues.empty()) { // prepare update query TString strQuery = boost::str(boost::wformat(L"UPDATE %1% SET ") % strContainerName).c_str(); @@ -187,14 +199,15 @@ strQuery += _T(" WHERE id=?"); int iColumn = 1; + + ATLTRACE(_T("Executing query: %s\n"), (PCTSTR)strQuery); tStatement.Prepare(strQuery); for(MapVariants::iterator iterVariant = m_mapValues.begin(); iterVariant != m_mapValues.end(); ++iterVariant) { boost::apply_visitor(SQLiteBindValueVisitor(tStatement, iColumn), iterVariant->second); } tStatement.BindValue(iColumn++, m_stRowID); - ATLTRACE(_T("Executing query: %s\n"), (PCTSTR)strQuery); tStatement.Step(); int iChanges = tStatement.Changes(); Index: src/libchcore/TSQLiteTaskSchema.cpp =================================================================== diff -u -r0b8ae6ab8b538881b651126bf8e6de9c9912a782 -r19925be73ffcadd9f345f10e03e55aadb3f0eeac --- src/libchcore/TSQLiteTaskSchema.cpp (.../TSQLiteTaskSchema.cpp) (revision 0b8ae6ab8b538881b651126bf8e6de9c9912a782) +++ src/libchcore/TSQLiteTaskSchema.cpp (.../TSQLiteTaskSchema.cpp) (revision 19925be73ffcadd9f345f10e03e55aadb3f0eeac) @@ -72,6 +72,21 @@ tStatement.Prepare(_T("CREATE TABLE subtasks(id BIGINT UNIQUE, type INT NOT NULL, is_current boolean NOT NULL, is_estimation boolean NOT NULL)")); tStatement.Step(); + tStatement.Prepare(_T("CREATE TABLE subtask_fastmove(id BIGINT UNIQUE, current_index INT NOT NULL, is_running boolean NOT NULL, total_size BIGINT NOT NULL, processed_size BIGINT NOT NULL, size_speed varchar(1024) NOT NULL, ") + _T("total_count BIGINT NOT NULL, processed_count BIGINT NOT NULL, count_speed varchar(1024) NOT NULL, ci_processed_size BIGINT NOT NULL, ci_total_size BIGINT NOT NULL, timer BIGINT NOT NULL, ") + _T("buffer_index INT NOT NULL, current_path varchar(32768) NOT NULL, suboperation_type INT NOT NULL)")); + tStatement.Step(); + + tStatement.Prepare(_T("CREATE TABLE subtask_delete(id BIGINT UNIQUE, current_index INT NOT NULL, is_running boolean NOT NULL, total_size BIGINT NOT NULL, processed_size BIGINT NOT NULL, size_speed varchar(1024) NOT NULL, ") + _T("total_count BIGINT NOT NULL, processed_count BIGINT NOT NULL, count_speed varchar(1024) NOT NULL, ci_processed_size BIGINT NOT NULL, ci_total_size BIGINT NOT NULL, timer BIGINT NOT NULL, ") + _T("buffer_index INT NOT NULL, current_path varchar(32768) NOT NULL, suboperation_type INT NOT NULL)")); + tStatement.Step(); + + tStatement.Prepare(_T("CREATE TABLE subtask_copymove(id BIGINT UNIQUE, current_index INT NOT NULL, cf_processed_size BIGINT NOT NULL, is_running boolean NOT NULL, total_size BIGINT NOT NULL, processed_size BIGINT NOT NULL, size_speed varchar(1024) NOT NULL, ") + _T("total_count BIGINT NOT NULL, processed_count BIGINT NOT NULL, count_speed varchar(1024) NOT NULL, ci_processed_size BIGINT NOT NULL, ci_total_size BIGINT NOT NULL, timer BIGINT NOT NULL, ") + _T("buffer_index INT NOT NULL, current_path varchar(32768) NOT NULL, suboperation_type INT NOT NULL)")); + tStatement.Step(); + // and finally set the database version to current one tVersion.SetVersion(1); } Index: src/libchcore/TSharedModificationTracker.h =================================================================== diff -u -rb193a95402f2bf4c456fb9d65d111caaf6994823 -r19925be73ffcadd9f345f10e03e55aadb3f0eeac --- src/libchcore/TSharedModificationTracker.h (.../TSharedModificationTracker.h) (revision b193a95402f2bf4c456fb9d65d111caaf6994823) +++ src/libchcore/TSharedModificationTracker.h (.../TSharedModificationTracker.h) (revision 19925be73ffcadd9f345f10e03e55aadb3f0eeac) @@ -55,6 +55,14 @@ m_rBitset[ChangeBit] = true; } + template + TSharedModificationTracker(Bitset& rBitset, const V1& rValue1, const V2& rValue2) : + m_tValue(rValue1, rValue2), + m_rBitset(rBitset) + { + m_rBitset[ChangeBit] = true; + } + TSharedModificationTracker& operator=(const TSharedModificationTracker& rValue) { if(this != &rValue) Index: src/libchcore/TSpeedTracker.cpp =================================================================== diff -u -r9b8cccbee0fcfeca28a112cc0253a7641f73f74f -r19925be73ffcadd9f345f10e03e55aadb3f0eeac --- src/libchcore/TSpeedTracker.cpp (.../TSpeedTracker.cpp) (revision 9b8cccbee0fcfeca28a112cc0253a7641f73f74f) +++ src/libchcore/TSpeedTracker.cpp (.../TSpeedTracker.cpp) (revision 19925be73ffcadd9f345f10e03e55aadb3f0eeac) @@ -5,6 +5,8 @@ #include "ErrorCodes.h" #include "TCoreException.h" #include "MathFunctions.h" +#include +#include "TStringArray.h" BEGIN_CHCORE_NAMESPACE @@ -191,4 +193,51 @@ } } +TString TSpeedTracker::ToString() const +{ + TString strData; + + strData += boost::lexical_cast(m_stNextSamplePos).c_str(); + strData += _T(";"); + + strData += boost::lexical_cast(m_dPartialSpeedNotInSamples).c_str(); + strData += _T(";"); + strData += boost::lexical_cast(m_ullTimeIntervalNotInSamples).c_str(); + strData += _T(";"); + strData += boost::lexical_cast(m_ullZeroIntervalData).c_str(); + strData += _T(";"); + + BOOST_FOREACH(double dVal, m_vSamples) + { + strData += boost::lexical_cast(dVal).c_str(); + strData += _T(";"); + } + + strData.TrimRightSelf(_T(";")); + + return strData; +} + +void TSpeedTracker::FromString(const TString& strData) +{ + TStringArray arrStrings; + strData.Split(_T(";"), arrStrings); + + const size_t SerializedMembers = 4; + if(arrStrings.GetCount() != m_stRequiredSamples + SerializedMembers) + THROW_CORE_EXCEPTION(eErr_InvalidArgument); + + Clear(); + + m_stNextSamplePos = boost::lexical_cast((PCTSTR)arrStrings.GetAt(0)); + m_dPartialSpeedNotInSamples = boost::lexical_cast((PCTSTR)arrStrings.GetAt(1)); + m_ullTimeIntervalNotInSamples = boost::lexical_cast((PCTSTR)arrStrings.GetAt(2)); + m_ullZeroIntervalData = boost::lexical_cast((PCTSTR)arrStrings.GetAt(3)); + + for(size_t stIndex = 4; stIndex < arrStrings.GetCount(); ++stIndex) + { + m_vSamples[stIndex - 4] = boost::lexical_cast((PCTSTR)arrStrings.GetAt(stIndex)); + } +} + END_CHCORE_NAMESPACE Index: src/libchcore/TSpeedTracker.h =================================================================== diff -u -r9b8cccbee0fcfeca28a112cc0253a7641f73f74f -r19925be73ffcadd9f345f10e03e55aadb3f0eeac --- src/libchcore/TSpeedTracker.h (.../TSpeedTracker.h) (revision 9b8cccbee0fcfeca28a112cc0253a7641f73f74f) +++ src/libchcore/TSpeedTracker.h (.../TSpeedTracker.h) (revision 19925be73ffcadd9f345f10e03e55aadb3f0eeac) @@ -2,6 +2,7 @@ #define __TSPEEDTRACKER_H__ #include "libchcore.h" +#include "TString.h" BEGIN_CHCORE_NAMESPACE @@ -16,6 +17,9 @@ // retrieves speed per second double GetSpeed() const; + TString ToString() const; + void FromString(const TString& strData); + private: TSpeedTracker(const TSpeedTracker&); TSpeedTracker& operator=(const TSpeedTracker&); Index: src/libchcore/TSubTaskArray.cpp =================================================================== diff -u -r0b8ae6ab8b538881b651126bf8e6de9c9912a782 -r19925be73ffcadd9f345f10e03e55aadb3f0eeac --- src/libchcore/TSubTaskArray.cpp (.../TSubTaskArray.cpp) (revision 0b8ae6ab8b538881b651126bf8e6de9c9912a782) +++ src/libchcore/TSubTaskArray.cpp (.../TSubTaskArray.cpp) (revision 19925be73ffcadd9f345f10e03e55aadb3f0eeac) @@ -40,55 +40,54 @@ /////////////////////////////////////////////////////////////////////////// // TSubTasksArray -TSubTasksArray::TSubTasksArray() : - m_pSubTaskContext(NULL), +TSubTasksArray::TSubTasksArray(TSubTaskContext& rSubTaskContext) : +m_rSubTaskContext(rSubTaskContext), m_eOperationType(eOperation_None), m_lSubOperationIndex(0), m_lLastStoredIndex(-1) { } TSubTasksArray::TSubTasksArray(const TOperationPlan& rOperationPlan, TSubTaskContext& rSubTaskContext) : - m_pSubTaskContext(NULL), + m_rSubTaskContext(rSubTaskContext), m_eOperationType(eOperation_None), m_lSubOperationIndex(0), m_lLastStoredIndex(-1) { - Init(rOperationPlan, rSubTaskContext); + Init(rOperationPlan); } TSubTasksArray::~TSubTasksArray() { } -void TSubTasksArray::Init(const TOperationPlan& rOperationPlan, TSubTaskContext& rSubTaskContext) +void TSubTasksArray::Init(const TOperationPlan& rOperationPlan) { m_vSubTasks.clear(); m_lSubOperationIndex.store(0, boost::memory_order_release); - m_pSubTaskContext = &rSubTaskContext; m_eOperationType = rOperationPlan.GetOperationType(); switch(m_eOperationType) { case eOperation_Copy: { - TSubTaskBasePtr spOperation = boost::make_shared(boost::ref(rSubTaskContext)); + TSubTaskBasePtr spOperation = boost::make_shared(boost::ref(m_rSubTaskContext)); AddSubTask(spOperation, true); - spOperation = boost::make_shared(boost::ref(rSubTaskContext)); + spOperation = boost::make_shared(boost::ref(m_rSubTaskContext)); AddSubTask(spOperation, false); break; } case eOperation_Move: { - TSubTaskBasePtr spOperation = boost::make_shared(boost::ref(rSubTaskContext)); + TSubTaskBasePtr spOperation = boost::make_shared(boost::ref(m_rSubTaskContext)); AddSubTask(spOperation, true); - spOperation = boost::make_shared(boost::ref(rSubTaskContext)); + spOperation = boost::make_shared(boost::ref(m_rSubTaskContext)); AddSubTask(spOperation, false); - spOperation = boost::make_shared(boost::ref(rSubTaskContext)); + spOperation = boost::make_shared(boost::ref(m_rSubTaskContext)); AddSubTask(spOperation, false); - spOperation = boost::make_shared(boost::ref(rSubTaskContext)); + spOperation = boost::make_shared(boost::ref(m_rSubTaskContext)); AddSubTask(spOperation, false); break; @@ -114,9 +113,6 @@ TSubTaskBase::ESubOperationResult TSubTasksArray::Execute(bool bRunOnlyEstimationSubTasks) { - if(!m_pSubTaskContext) - THROW_CORE_EXCEPTION(eErr_InternalProblem); - TSubTaskBase::ESubOperationResult eResult = TSubTaskBase::eSubResult_Continue; size_t stSize = m_vSubTasks.size(); @@ -136,7 +132,7 @@ eResult = spCurrentSubTask->Exec(); - lIndex = m_lSubOperationIndex.fetch_add(1, boost::memory_order_release); + lIndex = m_lSubOperationIndex.fetch_add(1, boost::memory_order_release) + 1; } return eResult; @@ -230,9 +226,6 @@ void TSubTasksArray::Load(const ISerializerPtr& spSerializer) { - if(!m_pSubTaskContext) - THROW_CORE_EXCEPTION(eErr_InvalidData); - m_lLastStoredIndex = -1; ISerializerContainerPtr spContainer = spSerializer->GetContainer(_T("subtasks")); @@ -261,7 +254,7 @@ } // create subtask, load it and put into the array - TSubTaskBasePtr spSubTask = CreateSubtask((ESubOperationType)iType, *m_pSubTaskContext); + TSubTaskBasePtr spSubTask = CreateSubtask((ESubOperationType)iType, m_rSubTaskContext); spSubTask->Load(spSerializer); if(lID != m_vSubTasks.size()) Index: src/libchcore/TSubTaskArray.h =================================================================== diff -u -r0b8ae6ab8b538881b651126bf8e6de9c9912a782 -r19925be73ffcadd9f345f10e03e55aadb3f0eeac --- src/libchcore/TSubTaskArray.h (.../TSubTaskArray.h) (revision 0b8ae6ab8b538881b651126bf8e6de9c9912a782) +++ src/libchcore/TSubTaskArray.h (.../TSubTaskArray.h) (revision 19925be73ffcadd9f345f10e03e55aadb3f0eeac) @@ -40,11 +40,11 @@ class LIBCHCORE_API TSubTasksArray { public: - TSubTasksArray(); + TSubTasksArray(TSubTaskContext& rSubTaskContext); TSubTasksArray(const TOperationPlan& rOperationPlan, TSubTaskContext& rSubTaskContext); ~TSubTasksArray(); - void Init(const TOperationPlan& rOperationPlan, TSubTaskContext& rSubTaskContext); + void Init(const TOperationPlan& rOperationPlan); EOperationType GetOperationType() const; // Stats handling @@ -65,7 +65,7 @@ static TSubTaskBasePtr CreateSubtask(ESubOperationType eType, TSubTaskContext& rContext); private: - TSubTaskContext* m_pSubTaskContext; + TSubTaskContext& m_rSubTaskContext; EOperationType m_eOperationType; #pragma warning(push) Index: src/libchcore/TSubTaskCopyMove.cpp =================================================================== diff -u -r0b8ae6ab8b538881b651126bf8e6de9c9912a782 -r19925be73ffcadd9f345f10e03e55aadb3f0eeac --- src/libchcore/TSubTaskCopyMove.cpp (.../TSubTaskCopyMove.cpp) (revision 0b8ae6ab8b538881b651126bf8e6de9c9912a782) +++ src/libchcore/TSubTaskCopyMove.cpp (.../TSubTaskCopyMove.cpp) (revision 19925be73ffcadd9f345f10e03e55aadb3f0eeac) @@ -49,49 +49,21 @@ // class TCopyMoveProgressInfo TCopyMoveProgressInfo::TCopyMoveProgressInfo() : - m_stCurrentIndex(0), - m_ullCurrentFileProcessedSize(0) + m_stCurrentIndex(m_setModifications, 0), + m_ullCurrentFileProcessedSize(m_setModifications, 0) { + m_setModifications[eMod_Added] = true; } TCopyMoveProgressInfo::~TCopyMoveProgressInfo() { } -/* - void TCopyMoveProgressInfo::Serialize(TReadBinarySerializer& rSerializer) - { - size_t stIndex = 0; - unsigned long long ullFilePos = 0; - - Serializers::Serialize(rSerializer, stIndex); - Serializers::Serialize(rSerializer, ullFilePos); - - boost::unique_lock lock(m_lock); - m_stCurrentIndex = stIndex; - m_ullCurrentFileProcessedSize = ullFilePos; - } - - void TCopyMoveProgressInfo::Serialize(TWriteBinarySerializer& rSerializer) const - { - size_t stIndex = 0; - unsigned long long ullFilePos = 0; - - { - boost::shared_lock lock(m_lock); - stIndex = m_stCurrentIndex; - ullFilePos = m_ullCurrentFileProcessedSize; - } - - Serializers::Serialize(rSerializer, stIndex); - Serializers::Serialize(rSerializer, ullFilePos); - } -*/ - void TCopyMoveProgressInfo::ResetProgress() { boost::unique_lock lock(m_lock); m_stCurrentIndex = 0; + m_ullCurrentFileProcessedSize = 0; } void TCopyMoveProgressInfo::SetCurrentIndex(size_t stIndex) @@ -103,7 +75,7 @@ void TCopyMoveProgressInfo::IncreaseCurrentIndex() { boost::unique_lock lock(m_lock); - ++m_stCurrentIndex; + ++m_stCurrentIndex.Modify(); } size_t TCopyMoveProgressInfo::GetCurrentIndex() const @@ -127,8 +99,43 @@ void TCopyMoveProgressInfo::IncreaseCurrentFileProcessedSize(unsigned long long ullSizeToAdd) { boost::unique_lock lock(m_lock); - m_ullCurrentFileProcessedSize += ullSizeToAdd; + m_ullCurrentFileProcessedSize.Modify() += ullSizeToAdd; } + + void TCopyMoveProgressInfo::Store(const ISerializerRowDataPtr& spRowData) const + { + boost::shared_lock lock(m_lock); + if(m_setModifications.any()) + { + if(m_stCurrentIndex.IsModified()) + *spRowData % TRowData(_T("current_index"), m_stCurrentIndex); + if(m_ullCurrentFileProcessedSize.IsModified()) + *spRowData % TRowData(_T("cf_processed_size"), m_ullCurrentFileProcessedSize); + + m_setModifications.reset(); + } + } + + void TCopyMoveProgressInfo::InitLoader(const IColumnsDefinitionPtr& spColumns) + { + *spColumns % _T("current_index") % _T("cf_processed_size"); + } + + void TCopyMoveProgressInfo::Load(const ISerializerRowReaderPtr& spRowReader) + { + boost::unique_lock lock(m_lock); + + spRowReader->GetValue(_T("current_index"), m_stCurrentIndex.Modify()); + spRowReader->GetValue(_T("cf_processed_size"), m_ullCurrentFileProcessedSize.Modify()); + + m_setModifications.reset(); + } + + bool TCopyMoveProgressInfo::WasSerialized() const + { + boost::shared_lock lock(m_lock); + return !m_setModifications[eMod_Added]; + } } // assume max sectors of 4kB (for rounding) @@ -1286,14 +1293,38 @@ return TSubTaskBase::eSubResult_Continue; } + void TSubTaskCopyMove::Store(const ISerializerPtr& spSerializer) const { - spSerializer; + ISerializerContainerPtr spContainer = spSerializer->GetContainer(_T("subtask_copymove")); + ISerializerRowDataPtr spRow; + + if(m_tProgressInfo.WasSerialized()) + spRow = spContainer->GetRow(0); + else + spRow = spContainer->AddRow(0); + + m_tProgressInfo.Store(spRow); + m_tSubTaskStats.Store(spRow); } void TSubTaskCopyMove::Load(const ISerializerPtr& spSerializer) { - spSerializer; + ISerializerContainerPtr spContainer = spSerializer->GetContainer(_T("subtask_copymove")); + + IColumnsDefinitionPtr spColumns = spContainer->GetColumnsDefinition(); + if(spColumns->IsEmpty()) + { + details::TCopyMoveProgressInfo::InitLoader(spColumns); + TSubTaskStatsInfo::InitLoader(spColumns); + } + + ISerializerRowReaderPtr spRowReader = spContainer->GetRowReader(); + if(spRowReader->Next()) + { + m_tProgressInfo.Load(spRowReader); + m_tSubTaskStats.Load(spRowReader); + } } END_CHCORE_NAMESPACE Index: src/libchcore/TSubTaskCopyMove.h =================================================================== diff -u -r0b8ae6ab8b538881b651126bf8e6de9c9912a782 -r19925be73ffcadd9f345f10e03e55aadb3f0eeac --- src/libchcore/TSubTaskCopyMove.h (.../TSubTaskCopyMove.h) (revision 0b8ae6ab8b538881b651126bf8e6de9c9912a782) +++ src/libchcore/TSubTaskCopyMove.h (.../TSubTaskCopyMove.h) (revision 19925be73ffcadd9f345f10e03e55aadb3f0eeac) @@ -62,9 +62,28 @@ unsigned long long GetCurrentFileProcessedSize() const; void IncreaseCurrentFileProcessedSize(unsigned long long ullSizeToAdd); + void Store(const ISerializerRowDataPtr& spRowData) const; + static void InitLoader(const IColumnsDefinitionPtr& spColumns); + void Load(const ISerializerRowReaderPtr& spRowReader); + bool WasSerialized() const; + private: - volatile size_t m_stCurrentIndex; - volatile unsigned long long m_ullCurrentFileProcessedSize; // count of bytes processed for current file + enum EModifications + { + eMod_Added, + eMod_CurrentIndex, + eMod_CurrentFileProcessedSize, + + // last item + eMod_Last + }; + + typedef std::bitset Bitset; + mutable Bitset m_setModifications; + + TSharedModificationTracker m_stCurrentIndex; + TSharedModificationTracker m_ullCurrentFileProcessedSize; // count of bytes processed for current file + mutable boost::shared_mutex m_lock; }; } Index: src/libchcore/TSubTaskDelete.cpp =================================================================== diff -u -r0b8ae6ab8b538881b651126bf8e6de9c9912a782 -r19925be73ffcadd9f345f10e03e55aadb3f0eeac --- src/libchcore/TSubTaskDelete.cpp (.../TSubTaskDelete.cpp) (revision 0b8ae6ab8b538881b651126bf8e6de9c9912a782) +++ src/libchcore/TSubTaskDelete.cpp (.../TSubTaskDelete.cpp) (revision 19925be73ffcadd9f345f10e03e55aadb3f0eeac) @@ -44,28 +44,15 @@ // class TDeleteProgressInfo TDeleteProgressInfo::TDeleteProgressInfo() : - m_stCurrentIndex(0) + m_stCurrentIndex(0), + m_stLastStoredIndex(std::numeric_limits::max()) { } TDeleteProgressInfo::~TDeleteProgressInfo() { } -/* - void TDeleteProgressInfo::Serialize(TReadBinarySerializer& rSerializer) - { - boost::unique_lock lock(m_lock); - Serializers::Serialize(rSerializer, m_stCurrentIndex); - } - - void TDeleteProgressInfo::Serialize(TWriteBinarySerializer& rSerializer) const - { - boost::shared_lock lock(m_lock); - Serializers::Serialize(rSerializer, m_stCurrentIndex); - } -*/ - void TDeleteProgressInfo::ResetProgress() { boost::unique_lock lock(m_lock); @@ -89,6 +76,35 @@ boost::shared_lock lock(m_lock); return m_stCurrentIndex; } + + void TDeleteProgressInfo::Store(const ISerializerRowDataPtr& spRowData) const + { + boost::shared_lock lock(m_lock); + if(m_stCurrentIndex != m_stLastStoredIndex) + { + *spRowData % TRowData(_T("current_index"), m_stCurrentIndex); + m_stLastStoredIndex = m_stCurrentIndex; + } + } + + void TDeleteProgressInfo::InitLoader(const IColumnsDefinitionPtr& spColumns) + { + *spColumns % _T("current_index"); + } + + void TDeleteProgressInfo::Load(const ISerializerRowReaderPtr& spRowReader) + { + boost::unique_lock lock(m_lock); + + spRowReader->GetValue(_T("current_index"), m_stCurrentIndex); + m_stLastStoredIndex = m_stCurrentIndex; + } + + bool TDeleteProgressInfo::WasSerialized() const + { + boost::shared_lock lock(m_lock); + return m_stLastStoredIndex != std::numeric_limits::max(); + } } /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -236,12 +252,35 @@ void TSubTaskDelete::Store(const ISerializerPtr& spSerializer) const { - spSerializer; + ISerializerContainerPtr spContainer = spSerializer->GetContainer(_T("subtask_delete")); + ISerializerRowDataPtr spRow; + + if(m_tProgressInfo.WasSerialized()) + spRow = spContainer->GetRow(0); + else + spRow = spContainer->AddRow(0); + + m_tProgressInfo.Store(spRow); + m_tSubTaskStats.Store(spRow); } void TSubTaskDelete::Load(const ISerializerPtr& spSerializer) { - spSerializer; + ISerializerContainerPtr spContainer = spSerializer->GetContainer(_T("subtask_delete")); + + IColumnsDefinitionPtr spColumns = spContainer->GetColumnsDefinition(); + if(spColumns->IsEmpty()) + { + details::TDeleteProgressInfo::InitLoader(spColumns); + TSubTaskStatsInfo::InitLoader(spColumns); + } + + ISerializerRowReaderPtr spRowReader = spContainer->GetRowReader(); + if(spRowReader->Next()) + { + m_tProgressInfo.Load(spRowReader); + m_tSubTaskStats.Load(spRowReader); + } } END_CHCORE_NAMESPACE Index: src/libchcore/TSubTaskDelete.h =================================================================== diff -u -r0b8ae6ab8b538881b651126bf8e6de9c9912a782 -r19925be73ffcadd9f345f10e03e55aadb3f0eeac --- src/libchcore/TSubTaskDelete.h (.../TSubTaskDelete.h) (revision 0b8ae6ab8b538881b651126bf8e6de9c9912a782) +++ src/libchcore/TSubTaskDelete.h (.../TSubTaskDelete.h) (revision 19925be73ffcadd9f345f10e03e55aadb3f0eeac) @@ -48,8 +48,14 @@ void IncreaseCurrentIndex(); size_t GetCurrentIndex() const; + void Store(const ISerializerRowDataPtr& spRowData) const; + static void InitLoader(const IColumnsDefinitionPtr& spColumns); + void Load(const ISerializerRowReaderPtr& spRowReader); + bool WasSerialized() const; + private: size_t m_stCurrentIndex; + mutable size_t m_stLastStoredIndex; mutable boost::shared_mutex m_lock; }; } Index: src/libchcore/TSubTaskFastMove.cpp =================================================================== diff -u -r0b8ae6ab8b538881b651126bf8e6de9c9912a782 -r19925be73ffcadd9f345f10e03e55aadb3f0eeac --- src/libchcore/TSubTaskFastMove.cpp (.../TSubTaskFastMove.cpp) (revision 0b8ae6ab8b538881b651126bf8e6de9c9912a782) +++ src/libchcore/TSubTaskFastMove.cpp (.../TSubTaskFastMove.cpp) (revision 19925be73ffcadd9f345f10e03e55aadb3f0eeac) @@ -46,28 +46,15 @@ // class TFastMoveProgressInfo TFastMoveProgressInfo::TFastMoveProgressInfo() : - m_stCurrentIndex(0) + m_stCurrentIndex(0), + m_stLastStoredIndex(std::numeric_limits::max()) { } TFastMoveProgressInfo::~TFastMoveProgressInfo() { } -/* - void TFastMoveProgressInfo::Serialize(TReadBinarySerializer& rSerializer) - { - boost::unique_lock lock(m_lock); - Serializers::Serialize(rSerializer, m_stCurrentIndex); - } - - void TFastMoveProgressInfo::Serialize(TWriteBinarySerializer& rSerializer) const - { - boost::shared_lock lock(m_lock); - Serializers::Serialize(rSerializer, m_stCurrentIndex); - } -*/ - void TFastMoveProgressInfo::ResetProgress() { boost::unique_lock lock(m_lock); @@ -91,6 +78,35 @@ boost::shared_lock lock(m_lock); return m_stCurrentIndex; } + + void TFastMoveProgressInfo::Store(const ISerializerRowDataPtr& spRowData) const + { + boost::shared_lock lock(m_lock); + if(m_stCurrentIndex != m_stLastStoredIndex) + { + *spRowData % TRowData(_T("current_index"), m_stCurrentIndex); + m_stLastStoredIndex = m_stCurrentIndex; + } + } + + void TFastMoveProgressInfo::InitLoader(const IColumnsDefinitionPtr& spColumns) + { + *spColumns % _T("current_index"); + } + + void TFastMoveProgressInfo::Load(const ISerializerRowReaderPtr& spRowReader) + { + boost::unique_lock lock(m_lock); + + spRowReader->GetValue(_T("current_index"), m_stCurrentIndex); + m_stLastStoredIndex = m_stCurrentIndex; + } + + bool TFastMoveProgressInfo::WasSerialized() const + { + boost::shared_lock lock(m_lock); + return m_stLastStoredIndex != std::numeric_limits::max(); + } } TSubTaskFastMove::TSubTaskFastMove(TSubTaskContext& rContext) : @@ -295,12 +311,35 @@ void TSubTaskFastMove::Store(const ISerializerPtr& spSerializer) const { - spSerializer; + ISerializerContainerPtr spContainer = spSerializer->GetContainer(_T("subtask_fastmove")); + ISerializerRowDataPtr spRow; + + if(m_tProgressInfo.WasSerialized()) + spRow = spContainer->GetRow(0); + else + spRow = spContainer->AddRow(0); + + m_tProgressInfo.Store(spRow); + m_tSubTaskStats.Store(spRow); } void TSubTaskFastMove::Load(const ISerializerPtr& spSerializer) { - spSerializer; + ISerializerContainerPtr spContainer = spSerializer->GetContainer(_T("subtask_fastmove")); + + IColumnsDefinitionPtr spColumns = spContainer->GetColumnsDefinition(); + if(spColumns->IsEmpty()) + { + details::TFastMoveProgressInfo::InitLoader(spColumns); + TSubTaskStatsInfo::InitLoader(spColumns); + } + + ISerializerRowReaderPtr spRowReader = spContainer->GetRowReader(); + if(spRowReader->Next()) + { + m_tProgressInfo.Load(spRowReader); + m_tSubTaskStats.Load(spRowReader); + } } END_CHCORE_NAMESPACE Index: src/libchcore/TSubTaskFastMove.h =================================================================== diff -u -r0b8ae6ab8b538881b651126bf8e6de9c9912a782 -r19925be73ffcadd9f345f10e03e55aadb3f0eeac --- src/libchcore/TSubTaskFastMove.h (.../TSubTaskFastMove.h) (revision 0b8ae6ab8b538881b651126bf8e6de9c9912a782) +++ src/libchcore/TSubTaskFastMove.h (.../TSubTaskFastMove.h) (revision 19925be73ffcadd9f345f10e03e55aadb3f0eeac) @@ -50,8 +50,14 @@ void IncreaseCurrentIndex(); size_t GetCurrentIndex() const; + void Store(const ISerializerRowDataPtr& spRowData) const; + static void InitLoader(const IColumnsDefinitionPtr& spColumns); + void Load(const ISerializerRowReaderPtr& spRowReader); + bool WasSerialized() const; + private: size_t m_stCurrentIndex; + mutable size_t m_stLastStoredIndex; mutable boost::shared_mutex m_lock; }; } @@ -68,7 +74,7 @@ virtual void Reset(); virtual ESubOperationResult Exec(); - virtual ESubOperationType GetSubOperationType() const { return eSubOperation_Scanning; } + virtual ESubOperationType GetSubOperationType() const { return eSubOperation_FastMove; } virtual void Store(const ISerializerPtr& spSerializer) const; virtual void Load(const ISerializerPtr& spSerializer); Index: src/libchcore/TSubTaskStatsInfo.cpp =================================================================== diff -u -ra5f396da5ed5ffb3fcd9fdf22afb5a7fd07e1ab8 -r19925be73ffcadd9f345f10e03e55aadb3f0eeac --- src/libchcore/TSubTaskStatsInfo.cpp (.../TSubTaskStatsInfo.cpp) (revision a5f396da5ed5ffb3fcd9fdf22afb5a7fd07e1ab8) +++ src/libchcore/TSubTaskStatsInfo.cpp (.../TSubTaskStatsInfo.cpp) (revision 19925be73ffcadd9f345f10e03e55aadb3f0eeac) @@ -47,19 +47,21 @@ /////////////////////////////////////////////////////////////////////////////////// // class TSubTaskStatsInfo + TSubTaskStatsInfo::TSubTaskStatsInfo() : - m_bSubTaskIsRunning(false), - m_ullTotalSize(0), - m_ullProcessedSize(0), - m_stTotalCount(0), - m_stProcessedCount(0), - m_iCurrentBufferIndex(0), - m_strCurrentPath(), - m_tSizeSpeed(DefaultSpeedTrackTime, DefaultSpeedSampleTime), - m_tCountSpeed(DefaultSpeedTrackTime, DefaultSpeedSampleTime), - m_ullCurrentItemProcessedSize(0), - m_ullCurrentItemTotalSize(0), - m_eSubOperationType(eSubOperation_None) + m_bSubTaskIsRunning(m_setModifications, false), + m_ullTotalSize(m_setModifications, 0), + m_ullProcessedSize(m_setModifications, 0), + m_stTotalCount(m_setModifications, 0), + m_stProcessedCount(m_setModifications, 0), + m_iCurrentBufferIndex(m_setModifications, 0), + m_strCurrentPath(m_setModifications), + m_tSizeSpeed(m_setModifications, DefaultSpeedTrackTime, DefaultSpeedSampleTime), + m_tCountSpeed(m_setModifications, DefaultSpeedTrackTime, DefaultSpeedSampleTime), + m_ullCurrentItemProcessedSize(m_setModifications, 0), + m_ullCurrentItemTotalSize(m_setModifications, 0), + m_eSubOperationType(m_setModifications, eSubOperation_None), + m_tTimer(m_setModifications) { } @@ -71,10 +73,10 @@ m_stTotalCount = 0; m_stProcessedCount = 0; m_iCurrentBufferIndex = 0; - m_strCurrentPath.Clear(); - m_tTimer.Reset(); - m_tSizeSpeed.Clear(); - m_tCountSpeed.Clear(); + m_strCurrentPath.Modify().Clear(); + m_tTimer.Modify().Reset(); + m_tSizeSpeed.Modify().Clear(); + m_tCountSpeed.Modify().Clear(); m_ullCurrentItemProcessedSize = 0; m_ullCurrentItemTotalSize = 0; m_eSubOperationType = eSubOperation_None; @@ -88,7 +90,8 @@ spStatsSnapshot->Clear(); boost::upgrade_lock lock(m_lock); - UpdateTime(lock); + if(m_bSubTaskIsRunning) + UpdateTime(lock); spStatsSnapshot->SetRunning(m_bSubTaskIsRunning); spStatsSnapshot->SetProcessedCount(m_stProcessedCount); @@ -97,9 +100,9 @@ spStatsSnapshot->SetTotalSize(m_ullTotalSize); spStatsSnapshot->SetCurrentBufferIndex(m_iCurrentBufferIndex); spStatsSnapshot->SetCurrentPath(m_strCurrentPath); - spStatsSnapshot->SetTimeElapsed(m_tTimer.GetTotalTime()); - spStatsSnapshot->SetSizeSpeed(m_tSizeSpeed.GetSpeed()); - spStatsSnapshot->SetCountSpeed(m_tCountSpeed.GetSpeed()); + spStatsSnapshot->SetTimeElapsed(m_tTimer.Get().GetTotalTime()); + spStatsSnapshot->SetSizeSpeed(m_tSizeSpeed.Get().GetSpeed()); + spStatsSnapshot->SetCountSpeed(m_tCountSpeed.Get().GetSpeed()); spStatsSnapshot->SetCurrentItemProcessedSize(m_ullCurrentItemProcessedSize); spStatsSnapshot->SetCurrentItemTotalSize(m_ullCurrentItemTotalSize); spStatsSnapshot->SetSubOperationType(m_eSubOperationType); @@ -121,9 +124,9 @@ void TSubTaskStatsInfo::IncreaseProcessedCount(size_t stIncreaseBy) { boost::unique_lock lock(m_lock); - m_stProcessedCount += stIncreaseBy; + m_stProcessedCount.Modify() += stIncreaseBy; - m_tCountSpeed.AddSample(stIncreaseBy, m_tTimer.Tick()); + m_tCountSpeed.Modify().AddSample(stIncreaseBy, m_tTimer.Modify().Tick()); _ASSERTE(m_stProcessedCount <= m_stTotalCount); if(m_stProcessedCount > m_stTotalCount) @@ -134,7 +137,7 @@ { boost::unique_lock lock(m_lock); - m_tCountSpeed.AddSample(stProcessedCount - m_stProcessedCount, m_tTimer.Tick()); + m_tCountSpeed.Modify().AddSample(stProcessedCount - m_stProcessedCount, m_tTimer.Modify().Tick()); m_stProcessedCount = stProcessedCount; @@ -155,9 +158,9 @@ void TSubTaskStatsInfo::IncreaseProcessedSize(unsigned long long ullIncreaseBy) { boost::unique_lock lock(m_lock); - m_ullProcessedSize += ullIncreaseBy; + m_ullProcessedSize.Modify() += ullIncreaseBy; - m_tSizeSpeed.AddSample(ullIncreaseBy, m_tTimer.Tick()); + m_tSizeSpeed.Modify().AddSample(ullIncreaseBy, m_tTimer.Modify().Tick()); _ASSERTE(m_ullProcessedSize <= m_ullTotalSize); if(m_ullProcessedSize > m_ullTotalSize) @@ -168,7 +171,7 @@ { boost::unique_lock lock(m_lock); - m_tSizeSpeed.AddSample(ullProcessedSize - m_ullProcessedSize, m_tTimer.Tick()); + m_tSizeSpeed.Modify().AddSample(ullProcessedSize - m_ullProcessedSize, m_tTimer.Modify().Tick()); m_ullProcessedSize = ullProcessedSize; _ASSERTE(m_ullProcessedSize <= m_ullTotalSize); @@ -189,7 +192,7 @@ void TSubTaskStatsInfo::IncreaseCurrentItemProcessedSize(unsigned long long ullIncreaseBy) { boost::unique_lock lock(m_lock); - m_ullCurrentItemProcessedSize += ullIncreaseBy; + m_ullCurrentItemProcessedSize.Modify() += ullIncreaseBy; _ASSERTE(m_ullCurrentItemProcessedSize <= m_ullCurrentItemTotalSize); if(m_ullCurrentItemProcessedSize > m_ullCurrentItemTotalSize) @@ -232,21 +235,118 @@ void TSubTaskStatsInfo::EnableTimeTracking() { boost::unique_lock lock(m_lock); - m_tTimer.Start(); + m_tTimer.Modify().Start(); } void TSubTaskStatsInfo::DisableTimeTracking() { boost::unique_lock lock(m_lock); - m_tTimer.Stop(); + m_tTimer.Modify().Stop(); } void TSubTaskStatsInfo::UpdateTime(boost::upgrade_lock& lock) const { boost::upgrade_to_unique_lock lock_upgraded(lock); - m_tTimer.Tick(); - m_tSizeSpeed.AddSample(0, m_tTimer.GetLastTimestamp()); - m_tCountSpeed.AddSample(0, m_tTimer.GetLastTimestamp()); + m_tTimer.Modify().Tick(); + m_tSizeSpeed.Modify().AddSample(0, m_tTimer.Get().GetLastTimestamp()); + m_tCountSpeed.Modify().AddSample(0, m_tTimer.Get().GetLastTimestamp()); } +void TSubTaskStatsInfo::Store(const ISerializerRowDataPtr& spRowData) const +{ + boost::shared_lock lock(m_lock); + + if(m_bSubTaskIsRunning.IsModified()) + *spRowData % TRowData(_T("is_running"), m_bSubTaskIsRunning); + + if(m_ullTotalSize.IsModified()) + *spRowData % TRowData(_T("total_size"), m_ullTotalSize); + + if(m_ullProcessedSize.IsModified()) + *spRowData % TRowData(_T("processed_size"), m_ullProcessedSize); + if(m_tSizeSpeed.IsModified()) + *spRowData % TRowData(_T("size_speed"), m_tSizeSpeed.Get().ToString()); + + if(m_stTotalCount.IsModified()) + *spRowData % TRowData(_T("total_count"), m_stTotalCount); + if(m_ullProcessedSize.IsModified()) + *spRowData % TRowData(_T("processed_count"), m_stProcessedCount); + if(m_tSizeSpeed.IsModified()) + *spRowData % TRowData(_T("count_speed"), m_tCountSpeed.Get().ToString()); + + if(m_ullCurrentItemProcessedSize.IsModified()) + *spRowData % TRowData(_T("ci_processed_size"), m_ullCurrentItemProcessedSize); + if(m_ullCurrentItemTotalSize.IsModified()) + *spRowData % TRowData(_T("ci_total_size"), m_ullCurrentItemTotalSize); + + if(m_tTimer.IsModified()) + *spRowData % TRowData(_T("timer"), m_tTimer.Get().GetTotalTime()); + + if(m_iCurrentBufferIndex.IsModified()) + *spRowData % TRowData(_T("buffer_index"), m_iCurrentBufferIndex); + + if(m_strCurrentPath.IsModified()) + *spRowData % TRowData(_T("current_path"), m_strCurrentPath); + if(m_eSubOperationType.IsModified()) + *spRowData % TRowData(_T("suboperation_type"), m_eSubOperationType); + + m_setModifications.reset(); +} + +void TSubTaskStatsInfo::InitLoader(const IColumnsDefinitionPtr& spColumnDefs) +{ + if(!spColumnDefs) + THROW_CORE_EXCEPTION(eErr_InvalidPointer); + + *spColumnDefs + % _T("is_running") + % _T("total_size") + % _T("processed_size") + % _T("size_speed") + % _T("total_count") + % _T("processed_count") + % _T("count_speed") + % _T("ci_processed_size") + % _T("ci_total_size") + % _T("timer") + % _T("buffer_index") + % _T("current_path") + % _T("suboperation_type"); +} + +void TSubTaskStatsInfo::Load(const ISerializerRowReaderPtr& spRowReader) +{ + boost::unique_lock lock(m_lock); + + spRowReader->GetValue(_T("is_running"), m_bSubTaskIsRunning.Modify()); + + spRowReader->GetValue(_T("total_size"), m_ullTotalSize.Modify()); + + spRowReader->GetValue(_T("processed_size"), m_ullProcessedSize.Modify()); + + TString strSpeed; + spRowReader->GetValue(_T("size_speed"), strSpeed); + m_tSizeSpeed.Modify().FromString(strSpeed); + + spRowReader->GetValue(_T("total_count"), m_stTotalCount.Modify()); + spRowReader->GetValue(_T("processed_count"), m_stProcessedCount.Modify()); + + spRowReader->GetValue(_T("count_speed"), strSpeed); + m_tCountSpeed.Modify().FromString(strSpeed); + + spRowReader->GetValue(_T("ci_processed_size"), m_ullCurrentItemProcessedSize.Modify()); + spRowReader->GetValue(_T("ci_total_size"), m_ullCurrentItemTotalSize.Modify()); + + unsigned long long ullTimer = 0; + spRowReader->GetValue(_T("timer"), ullTimer); + m_tTimer.Modify().Init(ullTimer); + + spRowReader->GetValue(_T("buffer_index"), m_iCurrentBufferIndex.Modify()); + + spRowReader->GetValue(_T("current_path"), m_strCurrentPath.Modify()); + spRowReader->GetValue(_T("suboperation_type"), *(int*)&m_eSubOperationType.Modify()); + + m_setModifications.reset(); +} + END_CHCORE_NAMESPACE Index: src/libchcore/TSubTaskStatsInfo.h =================================================================== diff -u -ra5f396da5ed5ffb3fcd9fdf22afb5a7fd07e1ab8 -r19925be73ffcadd9f345f10e03e55aadb3f0eeac --- src/libchcore/TSubTaskStatsInfo.h (.../TSubTaskStatsInfo.h) (revision a5f396da5ed5ffb3fcd9fdf22afb5a7fd07e1ab8) +++ src/libchcore/TSubTaskStatsInfo.h (.../TSubTaskStatsInfo.h) (revision 19925be73ffcadd9f345f10e03e55aadb3f0eeac) @@ -29,6 +29,10 @@ #include "TSpeedTracker.h" #include "ESubTaskTypes.h" #include "TSubTaskStatsSnapshot.h" +#include "ISerializerRowData.h" +#include "ISerializerRowReader.h" +#include "TSharedModificationTracker.h" +#include BEGIN_CHCORE_NAMESPACE @@ -89,6 +93,11 @@ ESubOperationType GetSubOperationType() const { return m_eSubOperationType; } void SetSubOperationType(ESubOperationType val) { m_eSubOperationType = val; } + // serialization + void Store(const ISerializerRowDataPtr& spRowData) const; + static void InitLoader(const IColumnsDefinitionPtr& spColumnDefs); + void Load(const ISerializerRowReaderPtr& spRowReader); + private: TSubTaskStatsInfo(const TSubTaskStatsInfo&); TSubTaskStatsInfo& operator=(const TSubTaskStatsInfo&); @@ -103,26 +112,51 @@ void UpdateTime(boost::upgrade_lock& lock) const; private: - bool m_bSubTaskIsRunning; + enum EModifications + { + eMod_Added = 0, + eMod_IsRunning, + eMod_TotalSize, + eMod_ProcessedSize, + eMod_SizeSpeed, + eMod_TotalCount, + eMod_ProcessedCount, + eMod_CountSpeed, + eMod_CurrentItemProcessedSize, + eMod_CurrentItemTotalSize, + eMod_Timer, + eMod_CurrentBufferIndex, + eMod_CurrentPath, + eMod_SubOperationType, - unsigned long long m_ullTotalSize; - unsigned long long m_ullProcessedSize; - mutable TSpeedTracker m_tSizeSpeed; + // last item + eMod_Last + }; - size_t m_stTotalCount; - size_t m_stProcessedCount; - mutable TSpeedTracker m_tCountSpeed; + typedef std::bitset Bitset; + mutable Bitset m_setModifications; - unsigned long long m_ullCurrentItemProcessedSize; - unsigned long long m_ullCurrentItemTotalSize; + TSharedModificationTracker m_bSubTaskIsRunning; - mutable TSimpleTimer m_tTimer; + TSharedModificationTracker m_ullTotalSize; + TSharedModificationTracker m_ullProcessedSize; + mutable TSharedModificationTracker m_tSizeSpeed; - int m_iCurrentBufferIndex; + TSharedModificationTracker m_stTotalCount; + TSharedModificationTracker m_stProcessedCount; + mutable TSharedModificationTracker m_tCountSpeed; - TString m_strCurrentPath; // currently processed path + TSharedModificationTracker m_ullCurrentItemProcessedSize; + TSharedModificationTracker m_ullCurrentItemTotalSize; - ESubOperationType m_eSubOperationType; + mutable TSharedModificationTracker m_tTimer; + + TSharedModificationTracker m_iCurrentBufferIndex; + + TSharedModificationTracker m_strCurrentPath; // currently processed path + + TSharedModificationTracker m_eSubOperationType; + #pragma warning(push) #pragma warning(disable: 4251) mutable boost::shared_mutex m_lock; Index: src/libchcore/TTask.cpp =================================================================== diff -u -r0b8ae6ab8b538881b651126bf8e6de9c9912a782 -r19925be73ffcadd9f345f10e03e55aadb3f0eeac --- src/libchcore/TTask.cpp (.../TTask.cpp) (revision 0b8ae6ab8b538881b651126bf8e6de9c9912a782) +++ src/libchcore/TTask.cpp (.../TTask.cpp) (revision 19925be73ffcadd9f345f10e03e55aadb3f0eeac) @@ -52,7 +52,7 @@ m_bContinue(false), m_tSubTaskContext(m_tConfiguration, m_spSrcPaths, m_afFilters, m_files, m_cfgTracker, m_log, spFeedbackHandler, m_workerThread, m_fsLocal), - m_tSubTasksArray(), + m_tSubTasksArray(m_tSubTaskContext), m_spSerializer(spSerializer) { if(!spFeedbackHandler || !spSerializer) @@ -72,7 +72,7 @@ m_afFilters = rTaskDefinition.GetFilters(); m_tBaseData.SetTaskName(rTaskDefinition.GetTaskName()); - m_tSubTasksArray.Init(rTaskDefinition.GetOperationPlan(), m_tSubTaskContext); + m_tSubTasksArray.Init(rTaskDefinition.GetOperationPlan()); m_files.Clear(); m_tSubTaskContext.SetOperationType(m_tSubTasksArray.GetOperationType()); m_tSubTaskContext.SetDestinationPath(m_tBaseData.GetDestinationPath());