|
RInside Version 0.2.10
|
00001 // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*- 00002 // 00003 // RInsideCommon.h: R/C++ interface class library -- Easier R embedding into C++ 00004 // 00005 // Copyright (C) 2010 - 2011 Dirk Eddelbuettel and Romain Francois 00006 // 00007 // This file is part of RInside. 00008 // 00009 // RInside is free software: you can redistribute it and/or modify it 00010 // under the terms of the GNU General Public License as published by 00011 // the Free Software Foundation, either version 2 of the License, or 00012 // (at your option) any later version. 00013 // 00014 // RInside is distributed in the hope that it will be useful, but 00015 // WITHOUT ANY WARRANTY; without even the implied warranty of 00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 // GNU General Public License for more details. 00018 // 00019 // You should have received a copy of the GNU General Public License 00020 // along with RInside. If not, see <http://www.gnu.org/licenses/>. 00021 00022 #ifndef RINSIDE_RINSIDECOMMON_H 00023 #define RINSIDE_RINSIDECOMMON_H 00024 00025 #include <RInsideConfig.h> 00026 00027 #include <sys/time.h> // gettimeofday() 00028 #include <sys/types.h> // pid_t 00029 #include <unistd.h> // getpid() 00030 00031 #include <inttypes.h> // intptr_t (one day we use cinttypes from C++11) 00032 #include <stdint.h> // uint64_t (one day we use cstdint from C++11) 00033 00034 #include <string> 00035 #include <vector> 00036 #include <iostream> 00037 00038 #include <Rcpp.h> 00039 00040 #ifdef WIN32 00041 #ifndef Win32 00042 // needed for parts of Rembedded.h 00043 #define Win32 00044 #endif 00045 #endif 00046 00047 #ifndef WIN32 00048 // needed to turn-off stack checking, and we already have uintptr_t 00049 #define CSTACK_DEFNS 00050 #define HAVE_UINTPTR_T 00051 #endif 00052 00053 #include <Rembedded.h> 00054 #ifndef WIN32 00055 #define R_INTERFACE_PTRS 00056 #include <Rinterface.h> 00057 #endif 00058 #include <R_ext/RStartup.h> 00059 00060 #include <MemBuf.h> 00061 00062 // simple logging help 00063 inline void logTxtFunction(const char* file, const int line, const char* expression, const bool verbose) { 00064 if (verbose) { 00065 std::cout << file << ":" << line << " expression: " << expression << std::endl; 00066 } 00067 } 00068 00069 #ifdef logTxt 00070 #undef logTxt 00071 #endif 00072 //#define logTxt(x, b) logTxtFunction(__FILE__, __LINE__, x, b); 00073 #define logTxt(x, b) 00074 00075 #endif