📄 logicdatastructure.h.svn-base
字号:
/* * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *//*! \file LogicDataStructure.h<pre><b>File:</b> LogicDataStructure.h<b>Project:</b> Robocup Soccer Simulation Team: MecaTeam<b>Authors:</b> Orivaldo Vieira <b>Created:</b> 10/09/2006<b>Last Revision:</b> $ID$<b>Contents:</b> Este arquivo cont�m a declara��o da classe para LogicDataStructure e suas classes componentes. A LogicDataStructure � classe que disponibiliza uma estrutura de dados para se armazenar os padr�es l�gicos. Classes componentes: - QueryTree: �rvore de busca bin�ria; - TreeNodo: n� da �rvore bin�ria;<hr size=2><h2><b>Changes</b></h2><b>Date</b> <b>Author</b> <b>Comment</b>19/09/2006 Orivaldo Vieira Documenta��o</pre>*/#ifndef LOGICDATASTRUCTURE_H#define LOGICDATASTRUCTURE_H#include "LogicPattern.h"using std::string;class TreeNodo { friend class QueryTree; public: TreeNodo (); TreeNodo (LogicPattern* ptrPattern); ~TreeNodo (); void setPtrPattern (LogicPattern* ptrPattern); void print (); private: TreeNodo* m_ptrLeftNodo; TreeNodo* m_ptrRightNodo; LogicPattern* m_ptrLogicPattern;};class QueryTree { public: QueryTree (); ~QueryTree (); bool addPtrLogicPattern (LogicPattern* ptrPattern); bool queryPattern (LogicPattern* ptrPattern); LogicPattern* selectObjectAndAttribute (LogicPattern* ptrPattern); void printTree (); int comparePattern (LogicPattern* ptrPatternA, LogicPattern* ptrPatternB); int compareFullPattern (LogicPattern* ptrPatternA, LogicPattern* ptrPatternB);// bool updateValue (string _object, string _attribute, string _value); private: TreeNodo* m_ptrRootNodo; TreeNodo* m_ptrCurrentNodo; int treeType; void printTree (TreeNodo* ptrNodo); bool addPtrLogicPattern (TreeNodo** ptrNodo, LogicPattern* ptrPattern); bool findPtrLogicPattern (TreeNodo** ptrNodo, LogicPattern* ptrPattern); LogicPattern* findPtrObjectAndAttribute (TreeNodo** ptrNodo, LogicPattern* ptrPattern);// TreeNodo* findPtrTreeNodo (LogicPattern* pattern);};class LogicDataStructure { public: LogicDataStructure (); ~LogicDataStructure (); bool insert (string object, string attribute, string value); bool insert (LogicPattern* _prtLogicPattern); void printTree (int _type); bool query (LogicPattern* pattern); LogicPattern* selectObjectAndAttribute (LogicPattern* pattern); bool updateValue (string _object, string _attribute, string _value); private: LogicPattern* mpQueryPattern; QueryTree* m_objectTree; QueryTree* m_attributeTree;};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -