tagging release
[dasher.git] / trunk / Src / DasherCore / NodeManagerFactory.h
blobdf01782b7e5bc9f4631461831be806c32bbbadd9
1 // NodeManagerFactory.h
2 //
3 // Copyright (c) 2007 The Dasher Team
4 //
5 // This file is part of Dasher.
6 //
7 // Dasher is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 2 of the License, or
10 // (at your option) any later version.
12 // Dasher is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with Dasher; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef __nodemanagerfactory_h__
22 #define __nodemanagerfactory_h__
24 namespace Dasher {
25 // Forward declaration
26 class CDasherNode;
28 /// \ingroup Model
29 /// @{
31 /// Factory class for CNodeManager derived classes. The model here
32 /// is that node managers are provided via instances of CDasherNodes
33 /// which represent the roots of subtrees. References to the node
34 /// managers are then propagated through the child creation process.
35 ///
36 /// Individual factories may either implement simngleton managers,
37 /// which are shared by all nodes in a given class, or separate
38 /// manager instances for each subtree, in which case reference
39 /// counting is implemented.
40 ///
41 class CNodeManagerFactory {
42 public:
44 /// Create a root node of the appropriate class, instantiating a
45 /// node manager if appropriate.
46 ///
47 /// @param pParent Parent node for the root, NULL if it is the base of the tree.
48 /// @param iLower Lower bound within parent (unused if pParent is NULL).
49 /// @param iUpper Upper bound within parent (unused if pParent is NULL).
50 /// @param pUserData Subclass specific data used at creation time.
51 ///
52 /// @return The new root node.
53 ///
54 virtual CDasherNode *GetRoot(CDasherNode *pParent, int iLower, int iUpper, void *pUserData) = 0;
56 /// @}
59 #endif