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

rubywrapper.h

Go to the documentation of this file.
00001 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*-
00002 
00003    this file is part of rcssserver3D
00004    Fri May 9 2003
00005    Copyright (C) 2002,2003 Koblenz University
00006    Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group
00007    $Id: rubywrapper.h,v 1.4 2004/03/22 18:11:08 fruit Exp $
00008 
00009    This program is free software; you can redistribute it and/or modify
00010    it under the terms of the GNU General Public License as published by
00011    the Free Software Foundation; version 2 of the License.
00012 
00013    This program is distributed in the hope that it will be useful,
00014    but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016    GNU General Public License for more details.
00017 
00018    You should have received a copy of the GNU General Public License
00019    along with this program; if not, write to the Free Software
00020    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00021 */
00022 #ifndef ZEITGEIST_RUBYWRAPPER_H
00023 #define ZEITGEIST_RUBYWRAPPER_H
00024 
00025 //
00026 // Both <ruby.h> and "config.h" define PACKAGE_ constants.
00027 // To suppress compiler warnings about redefinitions they
00028 // are #undef'ed in this wrapper
00029 //
00030 
00031 #undef PACKAGE_BUGREPORT
00032 #undef PACKAGE_NAME
00033 #undef PACKAGE_STRING
00034 #undef PACKAGE_TARNAME
00035 #undef PACKAGE_VERSION
00036 
00037 #ifndef __GNUC__
00038 #define EXTERN extern __declspec(dllimport)
00039 #endif
00040 #include <ruby.h>
00041 #undef EXTERN
00042 
00043 #undef PACKAGE_BUGREPORT
00044 #undef PACKAGE_NAME
00045 #undef PACKAGE_STRING
00046 #undef PACKAGE_TARNAME
00047 #undef PACKAGE_VERSION
00048 
00049 #include <iostream>
00050 
00051 namespace zeitgeist
00052 {
00061     struct RbArguments
00062     {
00063         VALUE recv;
00064         ID id;
00065         int n;
00066         VALUE *argv;
00067 
00068         RbArguments(VALUE recv, ID id, int n, VALUE *argv) :
00069             recv(recv), id(id), n(n), argv(argv) {};
00070     };
00071 
00074     VALUE RbFuncallWrap(VALUE arg);
00075 
00079     VALUE RbEvalStringWrap(const std::string& str);
00080 
00085     VALUE RbEvalStringWrap(const std::string& str, int& error);
00086 
00088     std::string RbGetError();
00089 
00091     void RbPrintError();
00092 };
00093 
00094 #endif // ZEITGEIST_RUBYWRAPPER_H
00095 

Generated on Thu Apr 6 15:25:39 2006 for rcssserver3d by  doxygen 1.4.4