1 // TortoiseSVN - a Windows shell extension for easy version control
\r
3 // Copyright (C) 2003-2008 - TortoiseSVN
\r
5 // This program is free software; you can redistribute it and/or
\r
6 // modify it under the terms of the GNU General Public License
\r
7 // as published by the Free Software Foundation; either version 2
\r
8 // of the License, or (at your option) any later version.
\r
10 // This program is distributed in the hope that it will be useful,
\r
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 // GNU General Public License for more details.
\r
15 // You should have received a copy of the GNU General Public License
\r
16 // along with this program; if not, write to the Free Software Foundation,
\r
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\r
21 #include "DictionaryBasedTempPath.h"
\r
22 #include "SimpleList.h"
\r
23 #include "NodeClassification.h"
\r
25 using namespace LogCache;
\r
28 * \ingroup TortoiseProc
\r
29 * Helper class, representing a revision with all the required information
\r
30 * which we need to draw a revision graph.
\r
32 class CFullGraphNode
\r
36 /// copy target list type
\r
38 typedef simple_list<CFullGraphNode> CCopyTarget;
\r
46 boost::pool<> nodePool;
\r
47 CCopyTarget::factory copyTargetFactory;
\r
51 /// factory creation
\r
55 /// factory interface
\r
57 CFullGraphNode* Create ( const CDictionaryBasedTempPath& path
\r
58 , revision_t revision
\r
59 , CNodeClassification classification
\r
60 , CFullGraphNode* source);
\r
61 void Replace ( CFullGraphNode* toReplace
\r
62 , CFullGraphNode::CCopyTarget*& toMove
\r
63 , CNodeClassification newClassification);
\r
64 void Destroy (CFullGraphNode* node);
\r
67 friend class CFactory;
\r
73 CDictionaryBasedTempPath path;
\r
76 CCopyTarget* firstCopyTarget;
\r
78 CFullGraphNode* prev;
\r
79 CFullGraphNode* next;
\r
81 CFullGraphNode* copySource;
\r
83 revision_t revision;
\r
84 CNodeClassification classification;
\r
88 /// protect construction / destruction to force usage of pool
\r
90 CFullGraphNode ( const CDictionaryBasedTempPath& path
\r
91 , revision_t revision
\r
92 , CNodeClassification classification
\r
93 , CFullGraphNode* source
\r
94 , CCopyTarget::factory& copyTargetFactory);
\r
97 /// destruction utility
\r
99 void InsertAt ( CFullGraphNode* source
\r
100 , CCopyTarget::factory& copyTargetFactory);
\r
101 void DestroySubNodes ( CFactory& factory
\r
102 , CCopyTarget::factory& copyTargetFactory);
\r
108 void AddClassification (DWORD toAdd);
\r
112 const CDictionaryBasedTempPath& GetPath() const;
\r
113 CDictionaryBasedPath GetRealPath() const;
\r
115 const CFullGraphNode* GetCopySource() const;
\r
116 const CCopyTarget* GetFirstCopyTarget() const;
\r
117 CCopyTarget*& GetFirstCopyTarget();
\r
119 const CFullGraphNode* GetPrevious() const;
\r
120 CFullGraphNode* GetPrevious();
\r
121 const CFullGraphNode* GetNext() const;
\r
122 CFullGraphNode* GetNext();
\r
124 revision_t GetRevision() const;
\r
125 CNodeClassification GetClassification() const;
\r
129 /// CVisibleGraphNode modification
\r
131 inline void CFullGraphNode::AddClassification (DWORD toAdd)
\r
133 classification.Add (toAdd);
\r
136 /// CVisibleGraphNode data access
\r
138 inline const CDictionaryBasedTempPath& CFullGraphNode::GetPath() const
\r
143 inline CDictionaryBasedPath CFullGraphNode::GetRealPath() const
\r
145 return CDictionaryBasedPath (path.GetBasePath().GetDictionary(), realPathID);
\r
148 inline const CFullGraphNode* CFullGraphNode::GetCopySource() const
\r
153 inline const CFullGraphNode::CCopyTarget*
\r
154 CFullGraphNode::GetFirstCopyTarget() const
\r
156 return firstCopyTarget;
\r
159 inline CFullGraphNode::CCopyTarget*& CFullGraphNode::GetFirstCopyTarget()
\r
161 return firstCopyTarget;
\r
164 inline const CFullGraphNode* CFullGraphNode::GetPrevious() const
\r
169 inline CFullGraphNode* CFullGraphNode::GetPrevious()
\r
174 inline const CFullGraphNode* CFullGraphNode::GetNext() const
\r
179 inline CFullGraphNode* CFullGraphNode::GetNext()
\r
184 inline revision_t CFullGraphNode::GetRevision() const
\r
189 inline CNodeClassification CFullGraphNode::GetClassification() const
\r
191 return classification;
\r