X-Git-Url: https://ruin.nu/git/?p=germs.git;a=blobdiff_plain;f=src%2Fcomponenttree.h;fp=src%2Fcomponenttree.h;h=7a99c91614f6baa6f1f65b0642e923965e6d24b8;hp=0000000000000000000000000000000000000000;hb=dcd966c5fca7dca53ca1f605f70f13f019d29771;hpb=8e617d91244bf6c8b22503850e10909fa2071c44 diff --git a/src/componenttree.h b/src/componenttree.h new file mode 100644 index 0000000..7a99c91 --- /dev/null +++ b/src/componenttree.h @@ -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 +#include "misc.h" + +class ComponentTreeTest; + +class ComponentTree { + public: + struct Node { + Node(Node* parent, Component comp); + ~Node(); + + Node* _parent; + Component _comp; + std::vector _children; + }; + ComponentTree(const std::vector& 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