Index: src/libchcore/ConfigNode.cpp =================================================================== diff -u -ra44714d5c7ec0f50a376f4d0ea919ee5a224f834 -r95a466ca0a4f95851dcacf2b80e2084e0168b7e4 --- src/libchcore/ConfigNode.cpp (.../ConfigNode.cpp) (revision a44714d5c7ec0f50a376f4d0ea919ee5a224f834) +++ src/libchcore/ConfigNode.cpp (.../ConfigNode.cpp) (revision 95a466ca0a4f95851dcacf2b80e2084e0168b7e4) @@ -23,7 +23,6 @@ namespace details { - ConfigNode::ConfigNode(object_id_t oidObjectID, const TString& strNodeName, int iOrder, const TString& strValue) : m_oidObjectID(oidObjectID), m_iOrder(m_setModifications, iOrder), @@ -33,6 +32,29 @@ m_setModifications[eMod_Added] = true; } + ConfigNode::ConfigNode(const ConfigNode& rSrc) : + m_oidObjectID(rSrc.m_oidObjectID), + m_iOrder(m_setModifications, rSrc.m_iOrder), + m_strNodeName(m_setModifications, rSrc.m_strNodeName), + m_strValue(m_setModifications, rSrc.m_strValue) + { + m_setModifications = rSrc.m_setModifications; + } + + ConfigNode& ConfigNode::operator=(const ConfigNode& rSrc) + { + if(this != &rSrc) + { + m_oidObjectID = rSrc.m_oidObjectID; + m_iOrder = rSrc.m_iOrder; + m_strNodeName = rSrc.m_strNodeName; + m_strValue = rSrc.m_strValue; + m_setModifications = rSrc.m_setModifications; + } + + return *this; + } + TString ConfigNode::GetNodeName() const { return m_strNodeName; Index: src/libchcore/ConfigNode.h =================================================================== diff -u -ra44714d5c7ec0f50a376f4d0ea919ee5a224f834 -r95a466ca0a4f95851dcacf2b80e2084e0168b7e4 --- src/libchcore/ConfigNode.h (.../ConfigNode.h) (revision a44714d5c7ec0f50a376f4d0ea919ee5a224f834) +++ src/libchcore/ConfigNode.h (.../ConfigNode.h) (revision 95a466ca0a4f95851dcacf2b80e2084e0168b7e4) @@ -33,7 +33,10 @@ { public: ConfigNode(object_id_t oidObjectID, const TString& strNodeName, int iOrder, const TString& strValue); + ConfigNode(const ConfigNode& rSrc); + ConfigNode& operator=(const ConfigNode& rSrc); + TString GetNodeName() const; int GetOrder() const; Index: src/libchcore/ConfigNodeContainer.cpp =================================================================== diff -u -r39864b5fbb931e3b257afbd60cfb7f36f71d146d -r95a466ca0a4f95851dcacf2b80e2084e0168b7e4 --- src/libchcore/ConfigNodeContainer.cpp (.../ConfigNodeContainer.cpp) (revision 39864b5fbb931e3b257afbd60cfb7f36f71d146d) +++ src/libchcore/ConfigNodeContainer.cpp (.../ConfigNodeContainer.cpp) (revision 95a466ca0a4f95851dcacf2b80e2084e0168b7e4) @@ -339,7 +339,7 @@ { if(iter->m_strNodeName.Get().StartsWith(strSearch.c_str())) { - setExistingNames.insert(std::make_pair(iter->m_strNodeName.Get(), iter->m_iOrder)); + setExistingNames.insert(std::make_pair(iter->m_strNodeName.Get(), iter->m_iOrder.Get())); } } @@ -349,7 +349,7 @@ TString strNodeName = pszNode; strNodeName += _T(".") + iter->m_strNodeName; - std::set::iterator iterExisting = setExistingNames.find(std::make_pair(strNodeName, iter->m_iOrder)); + std::set::iterator iterExisting = setExistingNames.find(std::make_pair(strNodeName, iter->m_iOrder.Get())); if(iterExisting != setExistingNames.end()) { // node already exists - modify instead of delete+add @@ -583,7 +583,19 @@ for(NodeContainer::const_iterator iter = m_mic.begin(); iter != m_mic.end(); ++iter) { unsigned long long ullID = iter->m_oidObjectID; - _sntprintf_s(szBuffer, stBufferSize, _TRUNCATE, _T("Node (oid %I64u): %s.%ld = %s\n"), ullID, iter->m_strNodeName.Get().c_str(), iter->m_iOrder.Get(), iter->m_strValue.Get().c_str()); + int iNodeNameModified = iter->m_strNodeName.IsModified() ? 1 : 0; + int iNodeNameModified2 = iter->m_setModifications[ConfigNode::eMod_NodeName]; + int iOrderModified = iter->m_iOrder.IsModified() ? 1 : 0; + int iOrderModified2 = iter->m_setModifications[ConfigNode::eMod_Order]; + int iValueModified = iter->m_strValue.IsModified() ? 1 : 0; + int iValueModified2 = iter->m_setModifications[ConfigNode::eMod_Value]; + bool bAdded = iter->m_setModifications[ConfigNode::eMod_Added]; + + _sntprintf_s(szBuffer, stBufferSize, _TRUNCATE, _T("Node (oid %I64u): %s(%ld/%ld).%ld(%ld/%ld) = %s(%ld/%ld)%s\n"), ullID, + iter->m_strNodeName.Get().c_str(), iNodeNameModified, iNodeNameModified2, + iter->m_iOrder.Get(), iOrderModified, iOrderModified2, + iter->m_strValue.Get().c_str(), iValueModified, iValueModified2, + bAdded ? L" [added]" : L""); OutputDebugString(szBuffer); } } Index: src/libchcore/TBasePathData.cpp =================================================================== diff -u -ra44714d5c7ec0f50a376f4d0ea919ee5a224f834 -r95a466ca0a4f95851dcacf2b80e2084e0168b7e4 --- src/libchcore/TBasePathData.cpp (.../TBasePathData.cpp) (revision a44714d5c7ec0f50a376f4d0ea919ee5a224f834) +++ src/libchcore/TBasePathData.cpp (.../TBasePathData.cpp) (revision 95a466ca0a4f95851dcacf2b80e2084e0168b7e4) @@ -46,11 +46,11 @@ TBasePathData::TBasePathData(const TBasePathData& rEntry) : m_oidObjectID(rEntry.m_oidObjectID), - m_pathSrc(rEntry.m_pathSrc), - m_pathDst(rEntry.m_pathDst), - m_bSkipFurtherProcessing(rEntry.m_bSkipFurtherProcessing), - m_setModifications(rEntry.m_setModifications) + m_pathSrc(m_setModifications, rEntry.m_pathSrc), + m_pathDst(m_setModifications, rEntry.m_pathDst), + m_bSkipFurtherProcessing(m_setModifications, rEntry.m_bSkipFurtherProcessing) { + m_setModifications = rEntry.m_setModifications; } TBasePathData::TBasePathData(object_id_t oidObjectID, const TSmartPath& spSrcPath) : Index: src/libchcore/TConfig.cpp =================================================================== diff -u -re92d7e2b63df1305b23aa04132c45ad8747dc22c -r95a466ca0a4f95851dcacf2b80e2084e0168b7e4 --- src/libchcore/TConfig.cpp (.../TConfig.cpp) (revision e92d7e2b63df1305b23aa04132c45ad8747dc22c) +++ src/libchcore/TConfig.cpp (.../TConfig.cpp) (revision 95a466ca0a4f95851dcacf2b80e2084e0168b7e4) @@ -520,4 +520,11 @@ return SetValue(pszPropName, pathValue.ToWString()); } +#ifdef _DEBUG +void TConfig::Dump() +{ + GetImpl()->Dump(); +} +#endif + END_CHCORE_NAMESPACE Index: src/libchcore/TConfig.h =================================================================== diff -u -r5324d0ca7af614cb066df1f121a7a338c4f7d7ed -r95a466ca0a4f95851dcacf2b80e2084e0168b7e4 --- src/libchcore/TConfig.h (.../TConfig.h) (revision 5324d0ca7af614cb066df1f121a7a338c4f7d7ed) +++ src/libchcore/TConfig.h (.../TConfig.h) (revision 95a466ca0a4f95851dcacf2b80e2084e0168b7e4) @@ -112,6 +112,10 @@ void DelayNotifications(); void ResumeNotifications(); +#ifdef _DEBUG + void Dump(); +#endif + protected: void SendNotification(const TStringSet& rsetInfo); void SendNotification(PCTSTR pszInfo); Index: src/libchcore/TFileInfo.cpp =================================================================== diff -u -ra44714d5c7ec0f50a376f4d0ea919ee5a224f834 -r95a466ca0a4f95851dcacf2b80e2084e0168b7e4 --- src/libchcore/TFileInfo.cpp (.../TFileInfo.cpp) (revision a44714d5c7ec0f50a376f4d0ea919ee5a224f834) +++ src/libchcore/TFileInfo.cpp (.../TFileInfo.cpp) (revision 95a466ca0a4f95851dcacf2b80e2084e0168b7e4) @@ -46,16 +46,17 @@ } TFileInfo::TFileInfo(const TFileInfo& rSrc) : - m_pathFile(rSrc.m_pathFile), - m_spBasePathData(rSrc.m_spBasePathData), - m_dwAttributes(rSrc.m_dwAttributes), - m_uhFileSize(rSrc.m_uhFileSize), - m_ftCreation(rSrc.m_ftCreation), - m_ftLastAccess(rSrc.m_ftLastAccess), - m_ftLastWrite(rSrc.m_ftLastWrite), - m_uiFlags(rSrc.m_uiFlags), + m_pathFile(m_setModifications, rSrc.m_pathFile), + m_spBasePathData(m_setModifications, rSrc.m_spBasePathData), + m_dwAttributes(m_setModifications, rSrc.m_dwAttributes), + m_uhFileSize(m_setModifications, rSrc.m_uhFileSize), + m_ftCreation(m_setModifications, rSrc.m_ftCreation), + m_ftLastAccess(m_setModifications, rSrc.m_ftLastAccess), + m_ftLastWrite(m_setModifications, rSrc.m_ftLastWrite), + m_uiFlags(m_setModifications, rSrc.m_uiFlags), m_oidObjectID(rSrc.m_oidObjectID) { + m_setModifications = rSrc.m_setModifications; } TFileInfo::~TFileInfo() @@ -75,6 +76,7 @@ m_ftLastWrite = rSrc.m_ftLastWrite; m_uiFlags = rSrc.m_uiFlags; m_oidObjectID = rSrc.m_oidObjectID; + m_setModifications = rSrc.m_setModifications; } return *this; Index: src/libchcore/TModificationTracker.h =================================================================== diff -u -r213cc1a2b3530ea7cb31fd0dac258df23bcc3416 -r95a466ca0a4f95851dcacf2b80e2084e0168b7e4 --- src/libchcore/TModificationTracker.h (.../TModificationTracker.h) (revision 213cc1a2b3530ea7cb31fd0dac258df23bcc3416) +++ src/libchcore/TModificationTracker.h (.../TModificationTracker.h) (revision 95a466ca0a4f95851dcacf2b80e2084e0168b7e4) @@ -29,23 +29,23 @@ public: TModificationTracker() : m_tValue(), - m_chModified(eMod_None) + m_chModified(eMod_Modified) { } - TModificationTracker(const TModificationTracker& rSrc) : - m_chModified(rSrc.m_chModified), - m_tValue(rSrc.m_tValue) - { - } - template TModificationTracker(const V& rValue, bool bAdded) : m_tValue(rValue), m_chModified((char)eMod_Modified | (bAdded ? (char)eMod_Added : (char)eMod_None)) { } + TModificationTracker(const TModificationTracker& rSrc) : + m_chModified(rSrc.m_chModified), + m_tValue(rSrc.m_tValue) + { + } + TModificationTracker& operator=(const TModificationTracker& rSrc) { m_chModified = rSrc.m_chModified; @@ -71,6 +71,11 @@ return m_tValue; } + const T& Get() const + { + return m_tValue; + } + T& Modify() { m_chModified |= eMod_Modified; Index: src/libchcore/TSharedModificationTracker.h =================================================================== diff -u -ra44714d5c7ec0f50a376f4d0ea919ee5a224f834 -r95a466ca0a4f95851dcacf2b80e2084e0168b7e4 --- src/libchcore/TSharedModificationTracker.h (.../TSharedModificationTracker.h) (revision a44714d5c7ec0f50a376f4d0ea919ee5a224f834) +++ src/libchcore/TSharedModificationTracker.h (.../TSharedModificationTracker.h) (revision 95a466ca0a4f95851dcacf2b80e2084e0168b7e4) @@ -34,70 +34,49 @@ m_tValue(), m_rBitset(rBitset) { - m_rBitset[ChangeBit] = true; + MarkAsModified(); } - TSharedModificationTracker(const TSharedModificationTracker& rSrc) : - m_tValue(rSrc.m_tValue), - m_rBitset(rSrc.m_rBitset) - { - } + TSharedModificationTracker(const TSharedModificationTracker& rSrc) = delete; TSharedModificationTracker(const TSharedModificationTracker& rSrc, Bitset& rBitset) : m_tValue(rSrc.m_tValue), m_rBitset(rBitset) { - m_rBitset[ChangeBit] = rBitset[ChangeBit]; + m_rBitset[ChangeBit] = rSrc.m_rBitset[ChangeBit]; } - template - TSharedModificationTracker(Bitset& rBitset, const V& rValue) : - m_tValue(rValue), + template + TSharedModificationTracker(Bitset& rBitset, const V&... rValues) : + m_tValue(rValues...), m_rBitset(rBitset) { - m_rBitset[ChangeBit] = true; + MarkAsModified(); } - 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) { m_tValue = rValue.m_tValue; - if(m_tValue != rValue.m_tValue) - m_rBitset[ChangeBit] = true; + m_rBitset[ChangeBit] = rValue.m_rBitset[ChangeBit]; } return *this; } - TSharedModificationTracker& operator=(const T& rValue) + template + TSharedModificationTracker& operator=(const V& rValue) { if(m_tValue != rValue) { m_tValue = rValue; - m_rBitset[ChangeBit] = true; + MarkAsModified(); } return *this; } - template - TSharedModificationTracker& operator=(const V& rValue) - { - m_tValue = rValue; - m_rBitset[ChangeBit] = true; - - return *this; - } - operator const T&() const { return m_tValue; @@ -110,7 +89,7 @@ T& Modify() { - m_rBitset[ChangeBit] = true; + MarkAsModified(); return m_tValue; } @@ -119,6 +98,16 @@ return m_rBitset[ChangeBit]; } + void MarkAsModified() + { + m_rBitset[ChangeBit] = true; + } + + void MarkAsUnmodified() + { + m_rBitset[ChangeBit] = false; + } + private: T m_tValue; Bitset& m_rBitset; Index: src/libchcore/TSubTaskStatsInfo.cpp =================================================================== diff -u -rcdc76e1a95383dff63a5254aeb8d37035028512c -r95a466ca0a4f95851dcacf2b80e2084e0168b7e4 --- src/libchcore/TSubTaskStatsInfo.cpp (.../TSubTaskStatsInfo.cpp) (revision cdc76e1a95383dff63a5254aeb8d37035028512c) +++ src/libchcore/TSubTaskStatsInfo.cpp (.../TSubTaskStatsInfo.cpp) (revision 95a466ca0a4f95851dcacf2b80e2084e0168b7e4) @@ -59,8 +59,8 @@ m_bSubTaskIsRunning = false; m_ullTotalSize = 0; m_ullProcessedSize = 0; - m_fcTotalCount = 0; - m_fcProcessedCount = 0; + m_fcTotalCount = 0UL; + m_fcProcessedCount = 0UL; m_iCurrentBufferIndex = 0; m_strCurrentPath.Modify().Clear(); m_tTimer.Modify().Reset(); @@ -69,7 +69,7 @@ m_ullCurrentItemProcessedSize = 0; m_ullCurrentItemTotalSize = 0; m_bIsInitialized = false; - m_fcCurrentIndex = 0; + m_fcCurrentIndex = 0UL; m_bCurrentItemSilentResume = false; } Index: src/libchcore/TTaskInfo.cpp =================================================================== diff -u -ra44714d5c7ec0f50a376f4d0ea919ee5a224f834 -r95a466ca0a4f95851dcacf2b80e2084e0168b7e4 --- src/libchcore/TTaskInfo.cpp (.../TTaskInfo.cpp) (revision a44714d5c7ec0f50a376f4d0ea919ee5a224f834) +++ src/libchcore/TTaskInfo.cpp (.../TTaskInfo.cpp) (revision 95a466ca0a4f95851dcacf2b80e2084e0168b7e4) @@ -41,6 +41,29 @@ m_setModifications[eMod_Added] = true; } +TTaskInfoEntry::TTaskInfoEntry(const TTaskInfoEntry& rSrc) : + m_oidObjectID(rSrc.m_oidObjectID), + m_pathSerializeLocation(m_setModifications, rSrc.m_pathSerializeLocation), + m_iOrder(m_setModifications, rSrc.m_iOrder), + m_spTask(rSrc.m_spTask) +{ + m_setModifications = rSrc.m_setModifications; +} + +TTaskInfoEntry& TTaskInfoEntry::operator=(const TTaskInfoEntry& rSrc) +{ + if(this != &rSrc) + { + m_oidObjectID = rSrc.m_oidObjectID; + m_pathSerializeLocation = rSrc.m_pathSerializeLocation; + m_iOrder = rSrc.m_iOrder; + m_spTask = rSrc.m_spTask; + m_setModifications = rSrc.m_setModifications; + } + + return *this; +} + TSmartPath TTaskInfoEntry::GetTaskSerializeLocation() const { return m_pathSerializeLocation; Index: src/libchcore/TTaskInfo.h =================================================================== diff -u -ra44714d5c7ec0f50a376f4d0ea919ee5a224f834 -r95a466ca0a4f95851dcacf2b80e2084e0168b7e4 --- src/libchcore/TTaskInfo.h (.../TTaskInfo.h) (revision a44714d5c7ec0f50a376f4d0ea919ee5a224f834) +++ src/libchcore/TTaskInfo.h (.../TTaskInfo.h) (revision 95a466ca0a4f95851dcacf2b80e2084e0168b7e4) @@ -50,7 +50,10 @@ public: TTaskInfoEntry(); TTaskInfoEntry(object_id_t oidTaskID, const TSmartPath& pathTask, int iOrder, const TTaskPtr& spTask); + TTaskInfoEntry(const TTaskInfoEntry& rSrc); + TTaskInfoEntry& operator=(const TTaskInfoEntry& rSrc); + object_id_t GetObjectID() const; TSmartPath GetTaskSerializeLocation() const; Index: src/libchcore/libchcore.vc120.vcxproj =================================================================== diff -u -rcdc76e1a95383dff63a5254aeb8d37035028512c -r95a466ca0a4f95851dcacf2b80e2084e0168b7e4 --- src/libchcore/libchcore.vc120.vcxproj (.../libchcore.vc120.vcxproj) (revision cdc76e1a95383dff63a5254aeb8d37035028512c) +++ src/libchcore/libchcore.vc120.vcxproj (.../libchcore.vc120.vcxproj) (revision 95a466ca0a4f95851dcacf2b80e2084e0168b7e4) @@ -652,6 +652,18 @@ true true + + true + true + true + true + + + true + true + true + true + true true Index: src/libchcore/libchcore.vc120.vcxproj.filters =================================================================== diff -u -rcdc76e1a95383dff63a5254aeb8d37035028512c -r95a466ca0a4f95851dcacf2b80e2084e0168b7e4 --- src/libchcore/libchcore.vc120.vcxproj.filters (.../libchcore.vc120.vcxproj.filters) (revision cdc76e1a95383dff63a5254aeb8d37035028512c) +++ src/libchcore/libchcore.vc120.vcxproj.filters (.../libchcore.vc120.vcxproj.filters) (revision 95a466ca0a4f95851dcacf2b80e2084e0168b7e4) @@ -688,5 +688,11 @@ Source Files\Tools\Data Buffer + + Tests + + + Tests + \ No newline at end of file