Rcpp Version 0.9.10
preprocessor.h File Reference
#include <Rcpp/preprocessor_generated.h>
#include <Rcpp/preprocessor/cat.hpp>
Include dependency graph for preprocessor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Rcpp::internal::converter

Namespaces

namespace  Rcpp
 

Rcpp API.


namespace  Rcpp::internal
 

internal implementation details


Defines

#define RCPP_DECORATE(__FUN__)   __FUN__##__rcpp__wrapper__
#define BEGIN_RCPP   try{
#define VOID_END_RCPP   } catch( std::exception& __ex__ ){ forward_exception_to_r( __ex__ ) ; } catch(...){ ::Rf_error( "c++ exception (unknown reason)" ) ; }
#define END_RCPP   VOID_END_RCPP return R_NilValue;
#define RCPP_XP_FIELD_GET(__NAME__, __CLASS__, __FIELD__)
#define RCPP_XP_FIELD_SET(__NAME__, __CLASS__, __FIELD__)
#define RCPP_XP_FIELD(__PREFIX__, __CLASS__, __FIELD__)
#define RCPP_TRAITS(__CLASS__, __SEXPTYPE__)
#define RCPP_ENUM_TRAITS(__ENUM__)   RCPP_TRAITS(__ENUM__,INTSXP)
#define ___RCPP_HANDLE_CASE___(___RTYPE___, ___FUN___, ___OBJECT___, ___RCPPTYPE___)
#define ___RCPP_RETURN___(__FUN__, __SEXP__, __RCPPTYPE__)
#define RCPP_RETURN_VECTOR(_FUN_, _SEXP_)   ___RCPP_RETURN___( _FUN_, _SEXP_ , Vector )
#define RCPP_RETURN_MATRIX(_FUN_, _SEXP_)   ___RCPP_RETURN___( _FUN_, _SEXP_ , Matrix )

Define Documentation

#define ___RCPP_HANDLE_CASE___ (   ___RTYPE___,
  ___FUN___,
  ___OBJECT___,
  ___RCPPTYPE___ 
)
Value:
case ___RTYPE___ :                                                                                                                                      \
                return ___FUN___( ::Rcpp::___RCPPTYPE___< ___RTYPE___ >( ___OBJECT___ ) ) ;

Definition at line 125 of file preprocessor.h.

#define ___RCPP_RETURN___ (   __FUN__,
  __SEXP__,
  __RCPPTYPE__ 
)
Value:
SEXP __TMP__ = __SEXP__ ;                                                                                                                       \
        switch( TYPEOF( __TMP__ ) ){                                                                                                            \
                ___RCPP_HANDLE_CASE___( INTSXP  , __FUN__ , __TMP__ , __RCPPTYPE__ )                    \
                ___RCPP_HANDLE_CASE___( REALSXP , __FUN__ , __TMP__ , __RCPPTYPE__ )                    \
                ___RCPP_HANDLE_CASE___( RAWSXP  , __FUN__ , __TMP__ , __RCPPTYPE__ )                    \
                ___RCPP_HANDLE_CASE___( LGLSXP  , __FUN__ , __TMP__ , __RCPPTYPE__ )                    \
                ___RCPP_HANDLE_CASE___( CPLXSXP , __FUN__ , __TMP__ , __RCPPTYPE__ )                    \
                ___RCPP_HANDLE_CASE___( STRSXP  , __FUN__ , __TMP__ , __RCPPTYPE__ )                    \
                ___RCPP_HANDLE_CASE___( VECSXP  , __FUN__ , __TMP__ , __RCPPTYPE__ )                    \
                ___RCPP_HANDLE_CASE___( EXPRSXP , __FUN__ , __TMP__ , __RCPPTYPE__ )                    \
        default:                                                                                                                                                        \
                throw std::range_error( "not a vector" ) ;                                                                      \
        }

Definition at line 129 of file preprocessor.h.

#define RCPP_DECORATE (   __FUN__)    __FUN__##__rcpp__wrapper__

Definition at line 25 of file preprocessor.h.

#define RCPP_ENUM_TRAITS (   __ENUM__)    RCPP_TRAITS(__ENUM__,INTSXP)

Definition at line 122 of file preprocessor.h.

#define RCPP_RETURN_MATRIX (   _FUN_,
  _SEXP_ 
)    ___RCPP_RETURN___( _FUN_, _SEXP_ , Matrix )

Definition at line 145 of file preprocessor.h.

#define RCPP_RETURN_VECTOR (   _FUN_,
  _SEXP_ 
)    ___RCPP_RETURN___( _FUN_, _SEXP_ , Vector )

Definition at line 144 of file preprocessor.h.

Referenced by Rcpp::internal::rcpp_call_test_().

#define RCPP_TRAITS (   __CLASS__,
  __SEXPTYPE__ 
)
Value:
namespace Rcpp{ namespace traits {                                \
template<> struct r_type_traits< __CLASS__ >{                       \
        typedef r_type_primitive_tag r_category ;                     \
} ;                                                               \
template<> struct r_type_traits< std::pair< std::string , __CLASS__ > >{   \
        typedef r_type_pairstring_primitive_tag r_category ;          \
} ;                                                               \
template<> struct wrap_type_traits< __CLASS__ >{                    \
        typedef wrap_type_primitive_tag wrap_category ;               \
} ;                                                               \
template<> struct r_sexptype_traits< __CLASS__ >{                   \
        enum{ rtype = __SEXPTYPE__ } ;                                \
} ;                                                               \
} }

Definition at line 107 of file preprocessor.h.

#define RCPP_XP_FIELD (   __PREFIX__,
  __CLASS__,
  __FIELD__ 
)
Value:
RCPP_XP_FIELD_GET( RCPP_PP_CAT(__PREFIX__,_get), __CLASS__, __FIELD__ )    \
RCPP_XP_FIELD_SET( RCPP_PP_CAT(__PREFIX__,_set), __CLASS__, __FIELD__ )

Definition at line 102 of file preprocessor.h.

#define RCPP_XP_FIELD_GET (   __NAME__,
  __CLASS__,
  __FIELD__ 
)
Value:
extern "C" SEXP RCPP_PP_CAT(__NAME__,__rcpp_info__)(){         \
        using Rcpp::_ ;                                            \
        Rcpp::List info = Rcpp::List::create(                      \
        _["class"]  = #__CLASS__  ,                            \
        _["field"]  = #__FIELD__                              \
        )   ;                                                  \
    info.attr( "class" ) = "rcppxpfieldgetinfo" ;              \
    return info   ;                                            \
}                                                              \
extern "C" SEXP __NAME__( SEXP xp ){                           \
        SEXP res = R_NilValue ;                                    \
        BEGIN_RCPP                                                 \
		::Rcpp::XPtr< __CLASS__ > ptr(xp) ;                    \
                res = ::Rcpp::wrap( ptr->__FIELD__ ) ;                 \
        return res ;                                               \
        END_RCPP                                                   \
}

Definition at line 66 of file preprocessor.h.

#define RCPP_XP_FIELD_SET (   __NAME__,
  __CLASS__,
  __FIELD__ 
)
Value:
extern "C" SEXP RCPP_PP_CAT(__NAME__,__rcpp_info__)(){         \
        using Rcpp::_ ;                                            \
        Rcpp::List info = Rcpp::List::create(                      \
        _["class"]  = #__CLASS__  ,                            \
        _["field"]  = #__FIELD__                              \
        )   ;                                                  \
    info.attr( "class" ) = "rcppxpfieldsetinfo" ;              \
    return info   ;                                            \
}                                                              \
extern "C" SEXP __NAME__( SEXP xp, SEXP value ){               \
        BEGIN_RCPP                                                 \
		::Rcpp::XPtr< __CLASS__ > ptr(xp) ;                    \
                ptr->__FIELD__ = ::Rcpp::internal::converter(value) ;  \
        END_RCPP                                                   \
}

Definition at line 85 of file preprocessor.h.

#define VOID_END_RCPP   } catch( std::exception& __ex__ ){ forward_exception_to_r( __ex__ ) ; } catch(...){ ::Rf_error( "c++ exception (unknown reason)" ) ; }

Definition at line 55 of file preprocessor.h.

Referenced by Rcpp::class_< Class >::setProperty().

 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Defines