[Rinside-commits] r151 - pkg/src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sun May 2 13:14:49 CEST 2010
Author: romain
Date: 2010-05-02 13:14:49 +0200 (Sun, 02 May 2010)
New Revision: 151
Added:
pkg/src/RInsideConfig.h
Modified:
pkg/src/Callbacks.h
pkg/src/RInside.cpp
pkg/src/RInside.h
pkg/src/RInsideCommon.h
Log:
hide callbacks behind RINSIDE_CALLBACKS until they are less experimental
Modified: pkg/src/Callbacks.h
===================================================================
--- pkg/src/Callbacks.h 2010-04-21 14:02:10 UTC (rev 150)
+++ pkg/src/Callbacks.h 2010-05-02 11:14:49 UTC (rev 151)
@@ -24,6 +24,8 @@
#include "RInsideCommon.h"
+#ifdef RINSIDE_CALLBACKS
+
class Callbacks {
public:
@@ -64,3 +66,5 @@
} ;
#endif
+
+#endif
Modified: pkg/src/RInside.cpp
===================================================================
--- pkg/src/RInside.cpp 2010-04-21 14:02:10 UTC (rev 150)
+++ pkg/src/RInside.cpp 2010-05-02 11:14:49 UTC (rev 151)
@@ -50,12 +50,20 @@
instance_ = 0 ;
}
-RInside::RInside() : callbacks(0) {
+RInside::RInside()
+#ifdef RINSIDE_CALLBACKS
+ : callbacks(0)
+#endif
+{
initialize( 0, 0 );
}
-RInside::RInside(const int argc, const char* const argv[]) : callbacks(0) {
- initialize( argc, argv );
+RInside::RInside(const int argc, const char* const argv[])
+#ifdef RINSIDE_CALLBACKS
+: callbacks(0)
+#endif
+{
+initialize( argc, argv );
}
// TODO: use a vector<string> would make all this a bit more readable
@@ -322,6 +330,8 @@
/* callbacks */
+#ifdef RINSIDE_CALLBACKS
+
void Callbacks::Busy_( int which ){
R_is_busy = static_cast<bool>( which ) ;
Busy( R_is_busy ) ;
@@ -421,4 +431,4 @@
while( R_ReplDLLdo1() > 0 ) {}
}
-
+#endif
Modified: pkg/src/RInside.h
===================================================================
--- pkg/src/RInside.h 2010-04-21 14:02:10 UTC (rev 150)
+++ pkg/src/RInside.h 2010-05-02 11:14:49 UTC (rev 151)
@@ -30,7 +30,6 @@
private:
MemBuf mb_m;
Rcpp::Environment global_env ;
- Callbacks* callbacks ;
bool verbose_m; // private switch
@@ -42,6 +41,8 @@
static RInside* instance_ ;
+#ifdef RINSIDE_CALLBACKS
+ Callbacks* callbacks ;
friend void RInside_ShowMessage( const char* message) ;
friend void RInside_WriteConsoleEx( const char* message, int len, int oType ) ;
friend int RInside_ReadConsole(const char *prompt, unsigned char *buf, int len, int addtohistory) ;
@@ -49,11 +50,9 @@
friend void RInside_FlushConsole() ;
friend void RInside_ClearerrConsole() ;
friend void RInside_Busy(int which) ;
-
+#endif
+
public:
- void set_callbacks(Callbacks* callbacks_) ;
- void repl() ;
-
int parseEval(const std::string & line, SEXP &ans); // parse line, return in ans; error code rc
void parseEvalQ(const std::string & line); // parse line, no return (throws on error)
@@ -83,6 +82,12 @@
Rcpp::Environment::Binding operator[]( const std::string& name ) ;
static RInside& instance() ;
+
+#ifdef RINSIDE_CALLBACKS
+ void set_callbacks(Callbacks* callbacks_) ;
+ void repl() ;
+#endif
+
};
#endif
Modified: pkg/src/RInsideCommon.h
===================================================================
--- pkg/src/RInsideCommon.h 2010-04-21 14:02:10 UTC (rev 150)
+++ pkg/src/RInsideCommon.h 2010-05-02 11:14:49 UTC (rev 151)
@@ -20,6 +20,8 @@
#ifndef RINSIDE_RINSIDECOMMON_H
#define RINSIDE_RINSIDECOMMON_H
+#include "RInsideConfig.h"
+
#include <string>
#include <vector>
#include <iostream>
Added: pkg/src/RInsideConfig.h
===================================================================
--- pkg/src/RInsideConfig.h (rev 0)
+++ pkg/src/RInsideConfig.h 2010-05-02 11:14:49 UTC (rev 151)
@@ -0,0 +1,26 @@
+// RInsideConfig.h: R/C++ interface class library -- Easier R embedding into C++
+//
+// Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
+//
+// This file is part of RInside.
+//
+// RInside is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 2 of the License, or
+// (at your option) any later version.
+//
+// RInside is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with RInside. If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef RINSIDE_RINSIDECONFIG_H
+#define RINSIDE_RINSIDECONFIG_H
+
+// uncomment to turn on the experimental callbacks
+// #define RINSIDE_CALLBACKS
+
+#endif
More information about the Rinside-commits
mailing list