Clone
ixen <ixen@copyhandler.com>
committed
on 08 Feb 15
Automatic version bump after tagging 1.40Beta-svn625
LoggerImprovements + 5 more
src/libchcore/TBasePathData.h (+11 -15)
44 44         TSmartPath GetDestinationPath() const;
45 45         bool IsDestinationPathSet() const { return !m_pathDst.IsEmpty(); }
46 46
47 47         void Serialize(TReadBinarySerializer& rSerializer, bool bData);
48 48         void Serialize(TWriteBinarySerializer& rSerializer, bool bData);
49 49
50 50 private:
51 51         bool m_bSkipFurtherProcessing;  // specifies if the path should be (or not) processed further
52 52         TSmartPath m_pathDst;   // dest path
53 53 };
54 54
55 55 typedef boost::shared_ptr<TBasePathData> TBasePathDataPtr;
56 56
57 57 //////////////////////////////////////////////////////////////////////////
58 58 // TBasePathDataContainer
59 59
60 60 class LIBCHCORE_API TBasePathDataContainer
61 61 {
62 62 public:
63 63         // constructors/destructor
64           explicit TBasePathDataContainer(const TModPathContainer& tBasePaths);
  64         TBasePathDataContainer();
65 65         ~TBasePathDataContainer();
66 66
67 67         // standard access to data
68           TBasePathDataPtr GetAt(size_t iPos) const;
  68         bool Exists(size_t stObjectID) const;
  69         TBasePathDataPtr GetExisting(size_t stObjectID) const;
  70         TBasePathDataPtr Get(size_t stObjectID);
69 71
70           void SetCount(size_t stCount);
71           size_t GetCount() const;
72           void Add(const TBasePathDataPtr& pEntry);
73           void SetAt(size_t nIndex, const TBasePathDataPtr& pEntry);
74           void RemoveAt(size_t nIndex, size_t nCount = 1);
  72         void Remove(size_t stObjectID);
75 73         void Clear();
76 74
77           const TModPathContainer& GetBasePaths() const { return m_tBasePaths; }
  75         // inner object read interface (to not create new inner objects when reading non-existent data)
  76         bool GetSkipFurtherProcessing(size_t stObjectID) const;
  77         TSmartPath GetDestinationPath(size_t stObjectID) const;
  78         bool IsDestinationPathSet(size_t stObjectID) const;
78 79
79           // serialization
80           void Serialize(TReadBinarySerializer& rSerializer, bool bData);
81           void Serialize(TWriteBinarySerializer& rSerializer, bool bData);
82  
83 80 private:
84 81         TBasePathDataContainer(const TBasePathDataContainer& rSrc);
85 82         TBasePathDataContainer& operator=(const TBasePathDataContainer& rSrc);
86 83
87 84 protected:
88           const TModPathContainer& m_tBasePaths;
89  
90 85 #pragma warning(push)
91 86 #pragma warning(disable: 4251)
92           std::vector<TBasePathDataPtr> m_vEntries;
  87         typedef std::map<size_t, TBasePathDataPtr> MapEntries;
  88         MapEntries m_mapEntries;
93 89         mutable boost::shared_mutex m_lock;
94 90 #pragma warning(pop)
95 91 };
96 92
97 93 END_CHCORE_NAMESPACE
98 94
99 95 #endif // __TBASEPATHDATA_H__