00001 00002 /* 00003 | Author: Michael Schmidt; 00004 | Gunnar Jehl 00005 | 00006 | ************************* SOFTWARE LICENSE AGREEMENT *********************** 00007 | This source code is published under the BSD License. 00008 | 00009 | See file 'LICENSE.txt' that comes with this distribution or 00010 | http://dbis.informatik.uni-freiburg.de/index.php?project=GCX/license.php 00011 | for the full license agreement. 00012 | 00013 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00014 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00015 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00016 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00017 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00018 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00019 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00020 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00021 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00022 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00023 | POSSIBILITY OF SUCH DAMAGE. 00024 | **************************************************************************** 00025 */ 00026 00035 #ifndef VARIABLETREENODE_H 00036 #define VARIABLETREENODE_H 00037 00038 #include <vector> 00039 #include "varname.h" 00040 #include "outputstreammanip.h" 00041 00043 using namespace std; 00044 00056 class VariableTreeNode { 00057 00058 public: 00062 VariableTreeNode(); 00063 00071 VariableTreeNode(VariableTreeNode * _parent, unsigned _var, 00072 bool _direct_output); 00073 00077 virtual ~ VariableTreeNode(); 00078 00088 bool insertNode(unsigned parent_var, unsigned introduced_var, 00089 bool direct_output); 00090 00097 void print(OutputStream & dos); 00098 00104 inline unsigned getVar() { 00105 return var; 00106 } inline vector < VariableTreeNode * >*getChildren() { 00112 return &children; 00113 } 00114 00121 inline bool isDirectOutput() { 00122 return direct_output; 00123 } 00124 00125 private: 00133 void print(OutputStream & dos, unsigned indents); 00134 00139 VariableTreeNode *parent; 00140 00145 unsigned var; 00146 00151 vector < VariableTreeNode * >children; 00152 00157 bool direct_output; 00158 }; 00159 00160 #endif // VARIABLETREENODE_H