00001 /* 00002 Copyright 2007, 2008, 2009, 2010, 2011 Instituto de Sistemas e Robotica, Instituto Superior Tecnico 00003 00004 This file is part of MeRMaID. 00005 00006 MeRMaID is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU Lesser General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 (at your option) any later version. 00010 00011 MeRMaID is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU Lesser General Public License for more details. 00015 00016 You should have received a copy of the GNU Lesser General Public License 00017 along with MeRMaID. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 00020 00021 00022 /** 00023 * @Filename SemanticTree.hpp 00024 * @Description SemanticTree class definition. 00025 * @Status Implementing 00026 * @Version $Id: SemanticTree.hpp 1 2011-03-04 18:13:18Z jreis $ 00027 * @Maintainer Marco Barbosa + Nelson Ramos 00028 */ 00029 00030 00031 #ifndef __DATASEMANTICS_SEMANTICTREE_H_ 00032 #define __DATASEMANTICS_SEMANTICTREE_H_ 00033 00034 #include <string> 00035 #include "SemanticNode.hpp" 00036 00037 00038 00039 namespace mermaid 00040 { 00041 namespace support 00042 { 00043 namespace data 00044 { 00045 using boost::shared_ptr; 00046 00047 /** 00048 * @Class SemanticTree SemanticTree.hpp "SemanticTree.hpp" 00049 * @Description Class representing a semantic tree 00050 * @TODO restingir construção da arvore para apenas haver um nó por cada nome 00051 * @Author Marco Barbosa + Nelson Ramos 00052 */ 00053 00054 class SemanticTree 00055 { 00056 00057 public: 00058 00059 /** 00060 * @Description Constructor. 00061 * @Description Default constructor of a SemanticTree. 00062 * @Description It doesn't return a valid SemanticTree. 00063 */ 00064 //SemanticTree(); 00065 00066 /** 00067 * @Description Constructor. 00068 * @Description It builds a semantic tree based on a root node. 00069 * @Argument rootNode The root node of the tree 00070 */ 00071 SemanticTree (shared_ptr<SemanticNode> rootNode); 00072 00073 /** 00074 * @Description Root node getter. 00075 * @Returns The tree's root node. 00076 */ 00077 shared_ptr<SemanticNode> getRootNode(); 00078 00079 /** 00080 * @Description Checks if concept A is contained in concept B 00081 * @Parameter a Concept A 00082 * @Parameter b Concept B 00083 * @Returns TRUE if A is contained in B, FALSE otherwise 00084 */ 00085 bool aContainsB (std::string a, std::string b); 00086 00087 private: 00088 shared_ptr<SemanticNode> rootNode_; 00089 00090 }; // SemanticTree 00091 } // namespace data 00092 } // namespace support 00093 } // namespace mermaid 00094 00095 #endif // __DATASEMANTICS_SEMANTICTREE_H_ 00096