1 // TortoiseSVN - a Windows shell extension for easy version control
3 // Copyright (C) 2003-2008 - TortoiseSVN
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #include "VisibleGraphNode.h"
26 * Contains a filtered copy of some \ref CFullGraph instance.
28 * Acts as factory and container for all nodes and their sub-structres.
35 CVisibleGraphNode::CFactory nodeFactory
;
37 /// the graph is actually a forest of trees
39 std::vector
<CVisibleGraphNode
*> roots
;
41 /// where new roots should be inserted
43 size_t insertionIndex
;
47 /// construction / destruction
55 CVisibleGraphNode
* Add ( const CFullGraphNode
* base
56 , CVisibleGraphNode
* source
59 void ReplaceRoot (CVisibleGraphNode
* oldRoot
, CVisibleGraphNode
* newRoot
);
60 void RemoveRoot (CVisibleGraphNode
* root
);
61 void AddRoot (CVisibleGraphNode
* root
);
65 size_t GetRootCount() const;
66 CVisibleGraphNode
* GetRoot (size_t index
);
67 const CVisibleGraphNode
* GetRoot (size_t index
) const;
69 size_t GetNodeCount() const;
70 size_t GetInsertionIndex() const;
71 void SetInsertionIndex (size_t index
);
75 CVisibleGraphNode::CFactory
& GetFactory();
80 inline size_t CVisibleGraph::GetRootCount() const
85 inline const CVisibleGraphNode
* CVisibleGraph::GetRoot (size_t index
) const
90 inline CVisibleGraphNode
* CVisibleGraph::GetRoot (size_t index
)
95 inline size_t CVisibleGraph::GetNodeCount() const
97 return nodeFactory
.GetNodeCount();
100 inline size_t CVisibleGraph::GetInsertionIndex() const
102 return insertionIndex
;
105 inline void CVisibleGraph::SetInsertionIndex (size_t index
)
107 insertionIndex
= index
;
110 inline CVisibleGraphNode::CFactory
& CVisibleGraph::GetFactory()