Rcpp Version 0.9.10
Rcpp::Language Class Reference

#include <Language.h>

Inheritance diagram for Rcpp::Language:
Collaboration diagram for Rcpp::Language:

List of all members.

Public Member Functions

 Language ()
 Language (SEXP lang)
 Language (const Language &other)
Languageoperator= (const Language &other)
 Language (const std::string &symbol)
 Language (const Symbol &symbol)
 Language (const Function &function)
void setSymbol (const std::string &symbol)
void setSymbol (const Symbol &symbol)
void setFunction (const Function &function)
SEXP eval ()
SEXP eval (SEXP env)
 ~Language ()

Private Member Functions

virtual void update ()

Detailed Description

C++ wrapper around calls (LANGSXP SEXP)

This represents calls that can be evaluated

Definition at line 39 of file Language.h.


Constructor & Destructor Documentation

Rcpp::Language::Language ( )

Definition at line 26 of file Language.cpp.

Rcpp::Language::Language ( SEXP  lang)

Attempts to convert the SEXP to a call

Exceptions:
not_compatibleif the SEXP could not be converted to a call using as.call

Definition at line 28 of file Language.cpp.

References Rcpp::RObject::setSEXP().

Here is the call graph for this function:

Rcpp::Language::Language ( const Language other)

Definition at line 32 of file Language.cpp.

References Rcpp::RObject::asSexp(), and Rcpp::RObject::setSEXP().

Here is the call graph for this function:

Rcpp::Language::Language ( const std::string &  symbol) [explicit]

Creates a call using the given symbol as the function name

Parameters:
symbolsymbol name to call

Language( "rnorm" ) makes a SEXP similar to this (expressed in R) > as.call( as.list( as.name( "rnorm") ) ) > call( "rnorm" )

Definition at line 41 of file Language.cpp.

References Rcpp::RObject::setSEXP().

Here is the call graph for this function:

Rcpp::Language::Language ( const Symbol symbol) [explicit]

Creates a call using the given symbol as the function name

Parameters:
symbolsymbol name to call

Language( Symbol("rnorm") ) makes a SEXP similar to this: > call( "rnorm" )

Definition at line 45 of file Language.cpp.

References Rcpp::RObject::setSEXP().

Here is the call graph for this function:

Rcpp::Language::Language ( const Function function) [explicit]

Creates a call to the function

Parameters:
functionfunction to call

Definition at line 49 of file Language.cpp.

References Rcpp::RObject::setSEXP().

Here is the call graph for this function:

Rcpp::Language::~Language ( )

Definition at line 53 of file Language.cpp.


Member Function Documentation

SEXP Rcpp::Language::eval ( )

eval this call in the global environment

Definition at line 74 of file Language.cpp.

Referenced by Rcpp::binary_call< T1, T2, OUT >::operator()(), Rcpp::unary_call< T, OUT >::operator()(), and Rcpp::fixed_call< OUT >::operator()().

SEXP Rcpp::Language::eval ( SEXP  env)

eval this call in the requested environment

Definition at line 78 of file Language.cpp.

References Rcpp::RObject::m_sexp, and Rcpp::internal::try_catch().

Here is the call graph for this function:

Language & Rcpp::Language::operator= ( const Language other)

Definition at line 36 of file Language.cpp.

References Rcpp::RObject::asSexp(), and Rcpp::RObject::setSEXP().

Here is the call graph for this function:

void Rcpp::Language::setFunction ( const Function function)

sets the function

Definition at line 64 of file Language.cpp.

References Rcpp::RObject::m_sexp, and R_NilValue.

void Rcpp::Language::setSymbol ( const std::string &  symbol)

Creates a call to the given symbol using variable number of arguments

Parameters:
symbolsymbol
...Argsvariable length argument list. The type of each argument must be wrappable, meaning there need to be a wrap function that takes this type as its parameter

For example, Language( "rnorm", 10, 0.0 ) will create the same call as > call( "rnorm", 10L, 0.0 )

10 is wrapped as an integer vector using wrap( const& int ) 0.0 is wrapped as a numeric vector using wrap( const& double ) ... sets the symbol of the call

Definition at line 55 of file Language.cpp.

void Rcpp::Language::setSymbol ( const Symbol symbol)

sets the symbol of the call

Definition at line 59 of file Language.cpp.

References Rcpp::RObject::m_sexp, and R_NilValue.

void Rcpp::Language::update ( ) [private, virtual]

Reimplemented from Rcpp::RObject.

Definition at line 69 of file Language.cpp.

References Rcpp::RObject::m_sexp, and R_NilValue.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Defines