HyperspaceExplorer 0.7.1
|
00001 /* 00002 <one line to give the program's name and a brief idea of what it does.> 00003 Copyright (C) <year> <name of author> 00004 00005 This program is free software; you can redistribute it and/or modify 00006 it under the terms of the GNU General Public License as published by 00007 the Free Software Foundation; either version 2 of the License, or 00008 (at your option) any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License along 00016 with this program; if not, write to the Free Software Foundation, Inc., 00017 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00018 00019 */ 00020 00021 #include "Tree.h" 00022 00023 #define WTFISWRONGWITHYOU 00024 00025 template < class Node > 00026 Tree<Node>::Tree(): current_node_(), sub_trees_() { } 00027 00028 template < class Node > 00029 Tree<Node>::Tree(const Node &node): current_node_(node), sub_trees_() { } 00030 00031 template < class Node > 00032 const Node &Tree<Node>::getNode() const { return current_node_; } 00033 00034 template < class Node > 00035 Node &Tree<Node>::getNode() { return current_node_; } 00036 00037 template < class Node > 00038 void Tree<Node>::addNode(const Node &new_node) { 00039 addTree(Tree(new_node)); 00040 } 00041 00042 template < class Node > 00043 #ifdef WTFISWRONGWITHYOU 00044 const std::list< Tree<Node> > & 00045 #else 00046 const Tree<Node>::sub_tree_type & 00047 #endif 00048 Tree<Node>::getSubTrees() const { 00049 return sub_trees_; 00050 } 00051 00052 template < class Node > 00053 #ifdef WTFISWRONGWITHYOU 00054 std::list< Tree<Node> > & 00055 #else 00056 Tree<Node>::sub_tree_type & 00057 #endif 00058 Tree<Node>::getSubTrees() { 00059 return sub_trees_; 00060 } 00061 00062 template < class Node > 00063 void Tree<Node>::addTree(const Tree<Node> &new_tree) { 00064 sub_trees_.push_back(new_tree); 00065 } 00066