00001 /* boss_node.h $Revision: 1.2 $ $Date: 2005/12/10 20:33:54 $ 00002 Copyright (C) 2000 University of Bonn. 00003 http://www.ikp.uni-bonn.de/boss 00004 00005 This program is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU General Public License 00007 as published by the Free Software Foundation; either version 2 00008 of the License, or (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 00016 along with this program; if not, write to the Free Software 00017 Foundation, Inc., 59 Temple Place - Suite 330, 00018 Boston, MA 02111-1307, USA. 00019 */ 00020 00028 #ifndef BOSS_NODE_DE_H 00029 #define BOSS_NODE_DE_H 00030 00031 using namespace std; 00032 00033 #include <string> 00034 #include "xercesc/dom/DOM.hpp" 00035 #include "boss_utility/dom_userdata.h" 00036 //#include "boss_utility/dom_tools.h" // included for getAttrByName in the constructor ($p) 00037 #include "boss_utility/boss_config.h" 00038 #include "boss_node.h" 00039 00047 class BOSS_NodeDE: public BOSS_Node { 00048 public: 00049 friend class CostDE; 00050 friend ostream & operator << (ostream & out, const BOSS_Node & n); 00051 BOSS_NodeDE(BOSS::Config & cl); 00052 BOSS_NodeDE(const BOSS_Node & b); 00053 BOSS_NodeDE(BOSS::Config & cl, const Node_Type & t); 00054 BOSS_NodeDE(BOSS::Config & cl, const xercesc::DOMNode * node, const Node_Type & t, const unsigned & p); 00055 ~BOSS_NodeDE(); 00056 BOSS_NodeDE & operator = (const BOSS_NodeDE & b); 00057 string getResult(const string & q) const { return user_data->getResult(pos, q); } 00058 const DOM_UserData * getUserData() const { return user_data; } 00059 inline Node_Type getNodeType() const { return type; } 00060 inline bool realNode() const 00061 { 00062 switch(type) { 00063 case INITIAL: 00064 case FINAL: 00065 return false; 00066 break; 00067 default: 00068 return true; 00069 break; 00070 } 00071 return true; 00072 } 00073 bool virtualNode() const { return !realNode(); } 00074 }; 00075 00076 //end of boss_unitselection group 00078 00079 #endif 00080