rubyinterpreter.h

00001 /***************************************************************************
00002  * rubyinterpreter.h
00003  * This file is part of the KDE project
00004  * copyright (C)2005 by Cyrille Berger (cberger@cberger.net)
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  * You should have received a copy of the GNU Library General Public License
00015  * along with this program; see the file COPYING.  If not, write to
00016  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018  ***************************************************************************/
00019 #ifndef KROSS_RUBYRUBYINTERPRETER_H
00020 #define KROSS_RUBYRUBYINTERPRETER_H
00021 
00022 #include <ruby.h>
00023 
00024 #include <api/interpreter.h>
00025 
00026 namespace Kross {
00027 
00028 namespace Ruby {
00029 
00030 class RubyInterpreterPrivate;
00031 /**
00032  * This class is the bridget between Kross and Ruby.
00033  * @author Cyrille Berger
00034  */
00035 class RubyInterpreter : public Kross::Api::Interpreter
00036 {
00037     public:
00038 
00039         /**
00040          * Constructor
00041          *
00042          * @param info The \a Kross::Api::InterpreterInfo instance
00043          *        that describes this \a RubyInterpreter .
00044          */
00045         RubyInterpreter(Kross::Api::InterpreterInfo* info);
00046 
00047         /**
00048          * Destructor.
00049          */
00050         ~RubyInterpreter();
00051 
00052         /**
00053          * Factory method to create and return a new \a RubyScript instance.
00054          */
00055         virtual Kross::Api::Script* createScript(Kross::Api::ScriptContainer* scriptcontainer);
00056 
00057     private:
00058         /// Initialize the ruby interpreter.
00059         void initRuby();
00060         /// Finalize the ruby interpreter.
00061         void finalizeRuby();
00062         /// Load an external plugin / module.
00063         static VALUE require (VALUE, VALUE);
00064     private:
00065         /// Private d-pointer.
00066         static RubyInterpreterPrivate* d;
00067 };
00068 
00069 }
00070 
00071 }
00072 
00073 #endif

Generated on Thu Feb 9 17:59:11 2006 for Kross by  doxygen 1.4.6