00001 /* 00002 * This source file is part of KEOS (Free 3D Engine) 00003 * For the latest info, see http://www.keosengine.org/ 00004 * E-mails : thierry.vouriot@keosengine.org, yeri@keosengine.org 00005 * 00006 * This program is free software; you can redistribute it and/or modify it under 00007 * the terms of the GNU Lesser General Public License as published by the Free Software 00008 * Foundation; either version 2 of the License, or (at your option) any later 00009 * version. 00010 * 00011 * This program is distributed in the hope that it will be useful, but WITHOUT 00012 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00013 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public License along with 00016 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00017 * Place - Suite 330, Boston, MA 02111-1307, USA, or go to 00018 * http://www.gnu.org/copyleft/lesser.txt. 00019 * 00020 */ 00021 00022 //========================================================== 00023 // ORIGINAL COPYRIGHT FOLLOWS 00024 //========================================================== 00025 // Yes::Engine - Free C++ 3D engine 00026 // 00027 // Copyright (C) 2004-2005 Laurent Gomila 00028 // 00029 // This program is free software; you can redistribute it and/or 00030 // modify it under the terms of the GNU General Public License 00031 // as published by the Free Software Foundation; either version 2 00032 // of the License, or (at your option) any later version. 00033 // 00034 // This program is distributed in the hope that it will be useful, 00035 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00036 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00037 // GNU General Public License for more details. 00038 // 00039 // You should have received a copy of the GNU General Public License 00040 // along with this program; if not, write to the Free Software 00041 // Foundation, Inc., 00042 // 59 Temple Place - Suite 330, 00043 // Boston, MA 02111-1307, USA. 00044 // 00045 // E-mail : laurent.gom@gmail.com 00046 //========================================================== 00047 00048 #ifndef KEOS_CONSOLEFUNCTOR_H 00049 #define KEOS_CONSOLEFUNCTOR_H 00050 00051 //========================================================== 00052 // En-têtes 00053 //========================================================== 00054 #include "KeosPrerequisites.h" 00055 #include "KeosString.h" 00056 #include "KeosException.h" 00057 00058 namespace Keos 00059 { 00060 namespace Console 00061 { 00065 class IFunction 00066 { 00067 public : 00068 00069 //---------------------------------------------------------- 00070 // Destructeur virtuel 00071 //---------------------------------------------------------- 00072 virtual ~IFunction() 00073 {} 00074 00075 //---------------------------------------------------------- 00076 // Effectue l'appel de fonction 00077 //---------------------------------------------------------- 00078 virtual std::string Execute(const std::string& Params) = 0; 00079 }; 00080 00084 class KEOS_EXPORT CFunctor 00085 { 00086 public : 00087 00088 //---------------------------------------------------------- 00089 // Construit le foncteur à partir d'une fonction 00090 //---------------------------------------------------------- 00091 CFunctor(IFunction* Func = NULL); 00092 00093 //---------------------------------------------------------- 00094 // Effectue l'appel à la fonction 00095 //---------------------------------------------------------- 00096 std::string operator ()(const std::string& Params = "") const; 00097 00098 private : 00099 00100 //---------------------------------------------------------- 00101 // Données membres 00102 //---------------------------------------------------------- 00103 CSmartPtr<IFunction> m_Function; 00104 }; 00105 00106 #include "KeosConsoleFunctor.inl" 00107 00108 } // namespace Console 00109 00110 } // namespace Keos 00111 00112 00113 #endif // KEOS_CONSOLEFUNCTOR_H
1.5.1-p1