]> ruin.nu Git - germs.git/blobdiff - src/componenttree.h
inital commit of componenttree with associated changes
[germs.git] / src / componenttree.h
diff --git a/src/componenttree.h b/src/componenttree.h
new file mode 100644 (file)
index 0000000..7a99c91
--- /dev/null
@@ -0,0 +1,52 @@
+/***************************************************************************
+ *   Copyright (C) 2006 by Michael Andreen                                 *
+ *   andreen@student.chalmers.se                                           *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   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 General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA          *
+ ***************************************************************************/
+
+#ifndef __COMPONENTTREE_H__
+#define __COMPONENTTREE_H__
+
+#include <vector>
+#include "misc.h"
+
+class ComponentTreeTest;
+
+class ComponentTree {
+       public:
+               struct Node {
+                       Node(Node* parent, Component comp);
+                       ~Node();
+
+                       Node* _parent;
+                       Component _comp;
+                       std::vector<Node*> _children;
+               };
+               ComponentTree(const std::vector<Component>& components);
+
+               ~ComponentTree();
+
+       private:
+               //Disable these, at least for now.
+               void operator=(const ComponentTree&){};
+               ComponentTree(const ComponentTree&): _root(0,Component()){};
+
+               Node _root;
+       friend class ComponentTreeTest;
+};
+
+#endif