00001 /* 00002 * Copyright (C) 2008 Kamil Dudka <xdudka00@stud.fit.vutbr.cz> 00003 * 00004 * This file is part of rob08 00005 * 00006 * rob08 is free software: you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation, either version 3 of the License, or 00009 * any later version. 00010 * 00011 * rob08 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 General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with rob08. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 00020 #ifndef CORE_H 00021 #define CORE_H 00022 00023 #include "config.h" 00024 #include "scanner.h" 00025 #include "term.h" 00026 00027 #ifndef BUILDING_DOX 00028 # include <string> 00029 #endif 00030 00031 class IEnviroment; 00032 class Trilobot; 00033 00035 class IListener: public IErrorSensitive { 00036 public: 00037 virtual ~IListener() { } 00038 00045 virtual bool dispatch(const Token &) = 0; 00046 }; 00047 00048 class ICanExportImport 00049 { 00050 public: 00051 virtual void Export( std::ostream& output ) =0; 00052 virtual void Import( std::istream& input ) =0; 00053 00054 virtual ~ICanExportImport() {} 00055 }; 00056 00059 class IExporter 00060 { 00061 public: 00063 virtual void MakeExport() =0; 00064 00065 virtual ~IExporter() {} 00066 }; 00067 00069 class ICore : public IListener, public ICanExportImport 00070 { 00071 public: 00072 virtual IEnviroment& GetEnviroment() =0; 00073 virtual Trilobot& GetTrilobot() =0; 00074 00075 virtual ~ICore() {} 00076 }; 00077 00079 class CoreFactory { 00080 public: 00081 /* 00082 * return on heap allocated core object 00083 * @attention IWriter object is not deleted by this module. 00084 */ 00085 static ICore* createCore(IWriter *); 00086 private: 00087 CoreFactory(); 00088 }; 00089 00090 #endif /* CORE_H */
1.5.4