Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

# KeosConsoleFunctor.h

Go to the documentation of this file.

    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             // Effectue l'appel de fonction
    00076             //----------------------------------------------------------
    00077             virtual std::string Execute(const std::string& Params) = 0;
    00078         };
    00079
    00083         class KEOS_EXPORT CFunctor
    00084         {
    00085         public :
    00086
    00087             //----------------------------------------------------------
    00088             // Construit le foncteur à partir d'une fonction
    00089             //----------------------------------------------------------
    00090             CFunctor(IFunction* Func = NULL);
    00091
    00092             //----------------------------------------------------------
    00093             // Effectue l'appel à la fonction
    00094             //----------------------------------------------------------
    00095             std::string operator ()(const std::string& Params = "") const;
    00096
    00097         private :
    00098
    00099             //----------------------------------------------------------
    00100             // Données membres
    00101             //----------------------------------------------------------
    00102             CSmartPtr<IFunction> m_Function;
    00103         };
    00104
    00105         #include "KeosConsoleFunctor.inl"
    00106
    00107     } // namespace Console
    00108
    00109 } // namespace Keos
    00110
    00111
    00112 #endif // KEOS_CONSOLEFUNCTOR_H