Index: src/ch/TSubTaskBase.cpp =================================================================== diff -u -N -r9a171c5d46f2bc029d99a698d88eeff60497cd3b -rd345f15636dc88c4c40fe310ac7777bd024e12d9 --- src/ch/TSubTaskBase.cpp (.../TSubTaskBase.cpp) (revision 9a171c5d46f2bc029d99a698d88eeff60497cd3b) +++ src/ch/TSubTaskBase.cpp (.../TSubTaskBase.cpp) (revision d345f15636dc88c4c40fe310ac7777bd024e12d9) @@ -22,7 +22,7 @@ // ============================================================================ #include "stdafx.h" #include "TSubTaskBase.h" -#include "TBasePathData.h" +#include "../libchcore/TBasePathData.h" #include "TLocalFilesystem.h" #include "TSubTaskContext.h" #include "../libchcore/TTaskDefinition.h" @@ -42,7 +42,7 @@ chcore::TSmartPath TSubTaskBase::CalculateDestinationPath(const CFileInfoPtr& spFileInfo, chcore::TSmartPath pathDst, int iFlags) const { - const TBasePathDataContainer& rSourcePathsInfo = GetContext().GetBasePathDataContainer(); + const chcore::TBasePathDataContainer& rSourcePathsInfo = GetContext().GetBasePathDataContainer(); if(!spFileInfo) THROW(_T("Invalid pointer"), 0, 0, 0); Index: src/ch/TSubTaskContext.cpp =================================================================== diff -u -N -rab32897e61cc637a1e28d9dc3f0489b8d16a429c -rd345f15636dc88c4c40fe310ac7777bd024e12d9 --- src/ch/TSubTaskContext.cpp (.../TSubTaskContext.cpp) (revision ab32897e61cc637a1e28d9dc3f0489b8d16a429c) +++ src/ch/TSubTaskContext.cpp (.../TSubTaskContext.cpp) (revision d345f15636dc88c4c40fe310ac7777bd024e12d9) @@ -23,7 +23,7 @@ #include "stdafx.h" #include "TSubTaskContext.h" -TSubTaskContext::TSubTaskContext(chcore::TTaskDefinition& rTaskDefinition, TBasePathDataContainer& rBasePathDataContainer, CFileInfoArray& rFilesCache, TTaskLocalStats& rTaskLocalStats, +TSubTaskContext::TSubTaskContext(chcore::TTaskDefinition& rTaskDefinition, chcore::TBasePathDataContainer& rBasePathDataContainer, CFileInfoArray& rFilesCache, TTaskLocalStats& rTaskLocalStats, TTaskBasicProgressInfo& rTaskBasicProgressInfo, TTaskConfigTracker& rCfgTracker, icpf::log_file& rLog, chcore::IFeedbackHandler* piFeedbackHandler, chcore::TWorkerThreadController& rThreadController, TLocalFilesystem& rfsLocal) : m_rTaskDefinition(rTaskDefinition), Index: src/ch/TSubTaskContext.h =================================================================== diff -u -N -rab32897e61cc637a1e28d9dc3f0489b8d16a429c -rd345f15636dc88c4c40fe310ac7777bd024e12d9 --- src/ch/TSubTaskContext.h (.../TSubTaskContext.h) (revision ab32897e61cc637a1e28d9dc3f0489b8d16a429c) +++ src/ch/TSubTaskContext.h (.../TSubTaskContext.h) (revision d345f15636dc88c4c40fe310ac7777bd024e12d9) @@ -30,9 +30,9 @@ class IFeedbackHandler; class TTaskDefinition; class TWorkerThreadController; + class TBasePathDataContainer; } -class TBasePathDataContainer; class TTaskLocalStats; class TTaskConfigTracker; class TTaskBasicProgressInfo; @@ -44,16 +44,16 @@ class TSubTaskContext { public: - TSubTaskContext(chcore::TTaskDefinition& rTaskDefinition, TBasePathDataContainer& rBasePathDataContainer, CFileInfoArray& rFilesCache, TTaskLocalStats& rTaskLocalStats, + TSubTaskContext(chcore::TTaskDefinition& rTaskDefinition, chcore::TBasePathDataContainer& rBasePathDataContainer, CFileInfoArray& rFilesCache, TTaskLocalStats& rTaskLocalStats, TTaskBasicProgressInfo& rTaskBasicProgressInfo, TTaskConfigTracker& rCfgTracker, icpf::log_file& rLog, chcore::IFeedbackHandler* piFeedbackHandler, chcore::TWorkerThreadController& rThreadController, TLocalFilesystem& rfsLocal); ~TSubTaskContext(); chcore::TTaskDefinition& GetTaskDefinition() { return m_rTaskDefinition; } const chcore::TTaskDefinition& GetTaskDefinition() const { return m_rTaskDefinition; } - TBasePathDataContainer& GetBasePathDataContainer() { return m_rBasePathDataContainer; } - const TBasePathDataContainer& GetBasePathDataContainer() const { return m_rBasePathDataContainer; } + chcore::TBasePathDataContainer& GetBasePathDataContainer() { return m_rBasePathDataContainer; } + const chcore::TBasePathDataContainer& GetBasePathDataContainer() const { return m_rBasePathDataContainer; } CFileInfoArray& GetFilesCache() { return m_rFilesCache; } const CFileInfoArray& GetFilesCache() const { return m_rFilesCache; } @@ -83,7 +83,7 @@ chcore::TTaskDefinition& m_rTaskDefinition; // information about input paths - TBasePathDataContainer& m_rBasePathDataContainer; + chcore::TBasePathDataContainer& m_rBasePathDataContainer; // data on which to operate CFileInfoArray& m_rFilesCache; Index: src/ch/TSubTaskCopyMove.cpp =================================================================== diff -u -N -r4be0f47d68a1a161529dc55901659b9daec996e3 -rd345f15636dc88c4c40fe310ac7777bd024e12d9 --- src/ch/TSubTaskCopyMove.cpp (.../TSubTaskCopyMove.cpp) (revision 4be0f47d68a1a161529dc55901659b9daec996e3) +++ src/ch/TSubTaskCopyMove.cpp (.../TSubTaskCopyMove.cpp) (revision d345f15636dc88c4c40fe310ac7777bd024e12d9) @@ -272,7 +272,7 @@ if(stBaseIndex >= GetContext().GetBasePathDataContainer().GetCount()) THROW(_T("Index out of bounds"), 0, 0, 0); - TBasePathDataPtr spPathData = GetContext().GetBasePathDataContainer().GetAt(stBaseIndex); + chcore::TBasePathDataPtr spPathData = GetContext().GetBasePathDataContainer().GetAt(stBaseIndex); return spPathData->GetMove(); } Index: src/ch/TSubTaskScanDirectory.cpp =================================================================== diff -u -N -r4be0f47d68a1a161529dc55901659b9daec996e3 -rd345f15636dc88c4c40fe310ac7777bd024e12d9 --- src/ch/TSubTaskScanDirectory.cpp (.../TSubTaskScanDirectory.cpp) (revision 4be0f47d68a1a161529dc55901659b9daec996e3) +++ src/ch/TSubTaskScanDirectory.cpp (.../TSubTaskScanDirectory.cpp) (revision d345f15636dc88c4c40fe310ac7777bd024e12d9) @@ -28,7 +28,7 @@ #include "FeedbackHandler.h" #include "TLocalFilesystem.h" #include "../libchcore/FeedbackHandlerBase.h" -#include "TBasePathData.h" +#include "../libchcore/TBasePathData.h" #include "../libchcore/TWorkerThreadController.h" #include "TTaskLocalStats.h" @@ -48,7 +48,7 @@ CFileInfoArray& rFilesCache = GetContext().GetFilesCache(); chcore::TTaskDefinition& rTaskDefinition = GetContext().GetTaskDefinition(); chcore::IFeedbackHandler* piFeedbackHandler = GetContext().GetFeedbackHandler(); - const TBasePathDataContainer& rarrSourcePathsInfo = GetContext().GetBasePathDataContainer(); + const chcore::TBasePathDataContainer& rarrSourcePathsInfo = GetContext().GetBasePathDataContainer(); chcore::TWorkerThreadController& rThreadController = GetContext().GetThreadController(); TTaskLocalStats& rTaskLocalStats = GetContext().GetTaskLocalStats(); Index: src/ch/ch.vc90.vcproj =================================================================== diff -u -N -r3d0d2c62687aa15c5720d8c9810258bc651a9a77 -rd345f15636dc88c4c40fe310ac7777bd024e12d9 --- src/ch/ch.vc90.vcproj (.../ch.vc90.vcproj) (revision 3d0d2c62687aa15c5720d8c9810258bc651a9a77) +++ src/ch/ch.vc90.vcproj (.../ch.vc90.vcproj) (revision d345f15636dc88c4c40fe310ac7777bd024e12d9) @@ -463,14 +463,6 @@ > - - - - Index: src/ch/task.h =================================================================== diff -u -N -r4be0f47d68a1a161529dc55901659b9daec996e3 -rd345f15636dc88c4c40fe310ac7777bd024e12d9 --- src/ch/task.h (.../task.h) (revision 4be0f47d68a1a161529dc55901659b9daec996e3) +++ src/ch/task.h (.../task.h) (revision d345f15636dc88c4c40fe310ac7777bd024e12d9) @@ -27,7 +27,7 @@ #include "FileFilter.h" #include "../libchcore/TTaskDefinition.h" #include "TTaskConfigTracker.h" -#include "TBasePathData.h" +#include "../libchcore/TBasePathData.h" #include "TSubTaskBase.h" #include "TTaskLocalStats.h" #include "TTaskGlobalStats.h" @@ -210,7 +210,7 @@ TTaskConfigTracker m_cfgTracker; - TBasePathDataContainer m_arrSourcePathsInfo; + chcore::TBasePathDataContainer m_arrSourcePathsInfo; // current task state (derivatives of the task initial information) // changing slowly or only partially Index: src/libchcore/TBasePathData.cpp =================================================================== diff -u -N --- src/libchcore/TBasePathData.cpp (revision 0) +++ src/libchcore/TBasePathData.cpp (revision d345f15636dc88c4c40fe310ac7777bd024e12d9) @@ -0,0 +1,191 @@ +// ============================================================================ +// Copyright (C) 2001-2010 by Jozef Starosczyk +// ixen@copyhandler.com +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License +// (version 2) as published by the Free Software Foundation; +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// ============================================================================ +/// @file TBasePathData.cpp +/// @date 2010/10/13 +/// @brief Contains implementations of classes related to keeping path data. +// ============================================================================ +#include "stdafx.h" +#include "TBasePathData.h" +#include "TBinarySerializer.h" +#include "SerializationHelpers.h" + +BEGIN_CHCORE_NAMESPACE + +////////////////////////////////////////////////////////////////////////////// +// TBasePathData + +TBasePathData::TBasePathData() : + m_bMove(true) +{ +} + +TBasePathData::TBasePathData(const TBasePathData& rEntry) : + m_bMove(rEntry.m_bMove), + m_pathDst(rEntry.m_pathDst) +{ +} + +void TBasePathData::SetDestinationPath(const chcore::TSmartPath& tPath) +{ + m_pathDst = tPath; +} + +chcore::TSmartPath TBasePathData::GetDestinationPath() const +{ + return m_pathDst; +} + +void TBasePathData::Serialize(chcore::TReadBinarySerializer& rSerializer, bool bData) +{ + if(bData) + chcore::Serializers::Serialize(rSerializer, m_bMove); + else + chcore::Serializers::Serialize(rSerializer, m_pathDst); +} + +void TBasePathData::Serialize(chcore::TWriteBinarySerializer& rSerializer, bool bData) +{ + if(bData) + chcore::Serializers::Serialize(rSerializer, m_bMove); + else + chcore::Serializers::Serialize(rSerializer, m_pathDst); +} + +////////////////////////////////////////////////////////////////////////////// +// TBasePathDataContainer + +TBasePathDataContainer::TBasePathDataContainer(const chcore::TPathContainer& tBasePaths) : + m_tBasePaths(tBasePaths) +{ +} + +TBasePathDataContainer::~TBasePathDataContainer() +{ + Clear(); +} + +TBasePathDataPtr TBasePathDataContainer::GetAt(size_t stPos) const +{ + boost::shared_lock lock(m_lock); + + if(stPos >= m_vEntries.size()) + THROW_CORE_EXCEPTION(eErr_BoundsExceeded); + + return m_vEntries.at(stPos); +} + +void TBasePathDataContainer::SetAt(size_t stIndex, const TBasePathDataPtr& spEntry) +{ + if(!spEntry) + THROW_CORE_EXCEPTION(eErr_InvalidArgument); + + boost::unique_lock lock(m_lock); + + if(stIndex >= m_vEntries.size()) + THROW_CORE_EXCEPTION(eErr_BoundsExceeded); + + m_vEntries[stIndex] = spEntry; +} + +void TBasePathDataContainer::Add(const TBasePathDataPtr& spEntry) +{ + boost::unique_lock lock(m_lock); + m_vEntries.push_back(spEntry); +} + +void TBasePathDataContainer::RemoveAt(size_t nIndex, size_t nCount) +{ + boost::unique_lock lock(m_lock); + m_vEntries.erase(m_vEntries.begin() + nIndex, m_vEntries.begin() + nIndex + nCount); +} + +void TBasePathDataContainer::Clear() +{ + boost::unique_lock lock(m_lock); + m_vEntries.clear(); +} + +void TBasePathDataContainer::SetCount(size_t stCount) +{ + boost::unique_lock lock(m_lock); + if(stCount > m_vEntries.size()) + { + size_t stCountToAdd = stCount - m_vEntries.size(); + while(stCountToAdd--) + { + TBasePathDataPtr spData(new TBasePathData); + m_vEntries.push_back(spData); + } + } +} + +size_t TBasePathDataContainer::GetCount() const +{ + boost::shared_lock lock(m_lock); + return m_vEntries.size(); +} + +void TBasePathDataContainer::Serialize(chcore::TReadBinarySerializer& rSerializer, bool bData) +{ + using chcore::Serializers::Serialize; + + size_t stCount; + Serialize(rSerializer, stCount); + + boost::unique_lock lock(m_lock); + + if(!bData && m_vEntries.size() != stCount) + THROW_CORE_EXCEPTION(eErr_InternalProblem); + + 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(rSerializer, bData); + + if(bData) + m_vEntries.push_back(spEntry); + } +} + +void TBasePathDataContainer::Serialize(chcore::TWriteBinarySerializer& rSerializer, bool bData) +{ + using chcore::Serializers::Serialize; + + boost::shared_lock lock(m_lock); + // write data + size_t stCount = m_vEntries.size(); + Serialize(rSerializer, stCount); + + BOOST_FOREACH(const TBasePathDataPtr& spEntry, m_vEntries) + { + spEntry->Serialize(rSerializer, bData); + } +} + +END_CHCORE_NAMESPACE Index: src/ch/TBasePathData.cpp =================================================================== diff -u -N --- src/ch/TBasePathData.cpp (revision 9a171c5d46f2bc029d99a698d88eeff60497cd3b) +++ src/ch/TBasePathData.cpp (revision 0) @@ -1,187 +0,0 @@ -// ============================================================================ -// Copyright (C) 2001-2010 by Jozef Starosczyk -// ixen@copyhandler.com -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU Library General Public License -// (version 2) as published by the Free Software Foundation; -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this program; if not, write to the -// Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// ============================================================================ -/// @file TBasePathData.cpp -/// @date 2010/10/13 -/// @brief Contains implementations of classes related to keeping path data. -// ============================================================================ -#include "stdafx.h" -#include "TBasePathData.h" -#include "..\libchcore\TBinarySerializer.h" -#include "..\libchcore\SerializationHelpers.h" - -////////////////////////////////////////////////////////////////////////////// -// TBasePathData - -TBasePathData::TBasePathData() : - m_bMove(true) -{ -} - -TBasePathData::TBasePathData(const TBasePathData& rEntry) : - m_bMove(rEntry.m_bMove), - m_pathDst(rEntry.m_pathDst) -{ -} - -void TBasePathData::SetDestinationPath(const chcore::TSmartPath& tPath) -{ - m_pathDst = tPath; -} - -chcore::TSmartPath TBasePathData::GetDestinationPath() const -{ - return m_pathDst; -} - -void TBasePathData::Serialize(chcore::TReadBinarySerializer& rSerializer, bool bData) -{ - if(bData) - chcore::Serializers::Serialize(rSerializer, m_bMove); - else - chcore::Serializers::Serialize(rSerializer, m_pathDst); -} - -void TBasePathData::Serialize(chcore::TWriteBinarySerializer& rSerializer, bool bData) -{ - if(bData) - chcore::Serializers::Serialize(rSerializer, m_bMove); - else - chcore::Serializers::Serialize(rSerializer, m_pathDst); -} - -////////////////////////////////////////////////////////////////////////////// -// TBasePathDataContainer - -TBasePathDataContainer::TBasePathDataContainer(const chcore::TPathContainer& tBasePaths) : - m_tBasePaths(tBasePaths) -{ -} - -TBasePathDataContainer::~TBasePathDataContainer() -{ - Clear(); -} - -TBasePathDataPtr TBasePathDataContainer::GetAt(size_t stPos) const -{ - boost::shared_lock lock(m_lock); - - if(stPos >= m_vEntries.size()) - THROW(_T("Out of range"), 0, 0, 0); - - return m_vEntries.at(stPos); -} - -void TBasePathDataContainer::SetAt(size_t stIndex, const TBasePathDataPtr& spEntry) -{ - if(!spEntry) - THROW(_T("Invalid argument"), 0, 0, 0); - - boost::unique_lock lock(m_lock); - - if(stIndex >= m_vEntries.size()) - THROW(_T("Out of range"), 0, 0, 0); - - m_vEntries[stIndex] = spEntry; -} - -void TBasePathDataContainer::Add(const TBasePathDataPtr& spEntry) -{ - boost::unique_lock lock(m_lock); - m_vEntries.push_back(spEntry); -} - -void TBasePathDataContainer::RemoveAt(size_t nIndex, size_t nCount) -{ - boost::unique_lock lock(m_lock); - m_vEntries.erase(m_vEntries.begin() + nIndex, m_vEntries.begin() + nIndex + nCount); -} - -void TBasePathDataContainer::Clear() -{ - boost::unique_lock lock(m_lock); - m_vEntries.clear(); -} - -void TBasePathDataContainer::SetCount(size_t stCount) -{ - boost::unique_lock lock(m_lock); - if(stCount > m_vEntries.size()) - { - size_t stCountToAdd = stCount - m_vEntries.size(); - while(stCountToAdd--) - { - TBasePathDataPtr spData(new TBasePathData); - m_vEntries.push_back(spData); - } - } -} - -size_t TBasePathDataContainer::GetCount() const -{ - boost::shared_lock lock(m_lock); - return m_vEntries.size(); -} - -void TBasePathDataContainer::Serialize(chcore::TReadBinarySerializer& rSerializer, bool bData) -{ - using chcore::Serializers::Serialize; - - size_t stCount; - Serialize(rSerializer, 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(rSerializer, bData); - - if(bData) - m_vEntries.push_back(spEntry); - } -} - -void TBasePathDataContainer::Serialize(chcore::TWriteBinarySerializer& rSerializer, bool bData) -{ - using chcore::Serializers::Serialize; - - boost::shared_lock lock(m_lock); - // write data - size_t stCount = m_vEntries.size(); - Serialize(rSerializer, stCount); - - BOOST_FOREACH(const TBasePathDataPtr& spEntry, m_vEntries) - { - spEntry->Serialize(rSerializer, bData); - } -} Index: src/libchcore/TBasePathData.h =================================================================== diff -u -N --- src/libchcore/TBasePathData.h (revision 0) +++ src/libchcore/TBasePathData.h (revision d345f15636dc88c4c40fe310ac7777bd024e12d9) @@ -0,0 +1,97 @@ +// ============================================================================ +// Copyright (C) 2001-2010 by Jozef Starosczyk +// ixen@copyhandler.com +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License +// (version 2) as published by the Free Software Foundation; +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// ============================================================================ +/// @file TBasePathData.h +/// @date 2010/10/13 +/// @brief Contains declarations of classes related to keeping additional path data. +// ============================================================================ +#ifndef __TBASEPATHDATA_H__ +#define __TBASEPATHDATA_H__ + +#include "libchcore.h" +#include "TPath.h" + +BEGIN_CHCORE_NAMESPACE + +///////////////////////////////////////////////////////////////////////////// +// TBasePathData +class LIBCHCORE_API TBasePathData +{ +public: + TBasePathData(); + TBasePathData(const TBasePathData& rEntry); + + void SetMove(bool bValue) { m_bMove=bValue; } + bool GetMove() const { return m_bMove; } + + void SetDestinationPath(const chcore::TSmartPath& strPath); + chcore::TSmartPath GetDestinationPath() const; + bool IsDestinationPathSet() const { return !m_pathDst.IsEmpty(); } + + 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) + + chcore::TSmartPath m_pathDst; // dest path +}; + +typedef boost::shared_ptr TBasePathDataPtr; + +////////////////////////////////////////////////////////////////////////// +// TBasePathDataContainer + +class LIBCHCORE_API TBasePathDataContainer +{ +public: + // constructors/destructor + explicit TBasePathDataContainer(const chcore::TPathContainer& tBasePaths); + ~TBasePathDataContainer(); + + // standard access to data + TBasePathDataPtr GetAt(size_t iPos) const; + + void SetCount(size_t stCount); + size_t GetCount() const; + void Add(const TBasePathDataPtr& pEntry); + void SetAt(size_t nIndex, const TBasePathDataPtr& pEntry); + void RemoveAt(size_t nIndex, size_t nCount = 1); + void Clear(); + + // serialization + void Serialize(chcore::TReadBinarySerializer& rSerializer, bool bData); + void Serialize(chcore::TWriteBinarySerializer& rSerializer, bool bData); + +private: + TBasePathDataContainer(const TBasePathDataContainer& rSrc); + TBasePathDataContainer& operator=(const TBasePathDataContainer& rSrc); + +protected: + const chcore::TPathContainer& m_tBasePaths; + +#pragma warning(push) +#pragma warning(disable: 4251) + std::vector m_vEntries; + mutable boost::shared_mutex m_lock; +#pragma warning(pop) +}; + +END_CHCORE_NAMESPACE + +#endif // __TBASEPATHDATA_H__ Index: src/ch/TBasePathData.h =================================================================== diff -u -N --- src/ch/TBasePathData.h (revision 9a171c5d46f2bc029d99a698d88eeff60497cd3b) +++ src/ch/TBasePathData.h (revision 0) @@ -1,89 +0,0 @@ -// ============================================================================ -// Copyright (C) 2001-2010 by Jozef Starosczyk -// ixen@copyhandler.com -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU Library General Public License -// (version 2) as published by the Free Software Foundation; -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this program; if not, write to the -// Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// ============================================================================ -/// @file TBasePathData.h -/// @date 2010/10/13 -/// @brief Contains declarations of classes related to keeping additional path data. -// ============================================================================ -#ifndef __TBASEPATHDATA_H__ -#define __TBASEPATHDATA_H__ - -#include "../libchcore/TPath.h" - -///////////////////////////////////////////////////////////////////////////// -// TBasePathData -class TBasePathData -{ -public: - TBasePathData(); - TBasePathData(const TBasePathData& rEntry); - - void SetMove(bool bValue) { m_bMove=bValue; } - bool GetMove() const { return m_bMove; } - - void SetDestinationPath(const chcore::TSmartPath& strPath); - chcore::TSmartPath GetDestinationPath() const; - bool IsDestinationPathSet() const { return !m_pathDst.IsEmpty(); } - - 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) - - chcore::TSmartPath m_pathDst; // dest path -}; - -typedef boost::shared_ptr TBasePathDataPtr; - -////////////////////////////////////////////////////////////////////////// -// TBasePathDataContainer - -class TBasePathDataContainer -{ -public: - // constructors/destructor - explicit TBasePathDataContainer(const chcore::TPathContainer& tBasePaths); - ~TBasePathDataContainer(); - - // standard access to data - TBasePathDataPtr GetAt(size_t iPos) const; - - void SetCount(size_t stCount); - size_t GetCount() const; - void Add(const TBasePathDataPtr& pEntry); - void SetAt(size_t nIndex, const TBasePathDataPtr& pEntry); - void RemoveAt(size_t nIndex, size_t nCount = 1); - void Clear(); - - // serialization - void Serialize(chcore::TReadBinarySerializer& rSerializer, bool bData); - void Serialize(chcore::TWriteBinarySerializer& rSerializer, bool bData); - -private: - TBasePathDataContainer(const TBasePathDataContainer& rSrc); - TBasePathDataContainer& operator=(const TBasePathDataContainer& rSrc); - -protected: - std::vector m_vEntries; - const chcore::TPathContainer& m_tBasePaths; - - mutable boost::shared_mutex m_lock; -}; - -#endif // __TBASEPATHDATA_H__ Index: src/libchcore/libchcore.vc90.vcproj =================================================================== diff -u -N -rab32897e61cc637a1e28d9dc3f0489b8d16a429c -rd345f15636dc88c4c40fe310ac7777bd024e12d9 --- src/libchcore/libchcore.vc90.vcproj (.../libchcore.vc90.vcproj) (revision ab32897e61cc637a1e28d9dc3f0489b8d16a429c) +++ src/libchcore/libchcore.vc90.vcproj (.../libchcore.vc90.vcproj) (revision d345f15636dc88c4c40fe310ac7777bd024e12d9) @@ -340,93 +340,13 @@ Name="Core" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +