Rcpp Version 0.9.10
Rcpp::RObject::AttributeProxy Class Reference

#include <RObject.h>

Collaboration diagram for Rcpp::RObject::AttributeProxy:

List of all members.

Public Member Functions

 AttributeProxy (const RObject &v, const std::string &attr_name)
AttributeProxyoperator= (const AttributeProxy &rhs)
template<typename T >
AttributeProxyoperator= (const T &rhs)
template<typename T >
 operator T () const

Private Member Functions

SEXP get () const
void set (SEXP x) const

Private Attributes

const RObjectparent
std::string attr_name

Detailed Description

Proxy for an object's attribute. Instances of this class are created by the attr member function of RObject.

When the proxy is used on the lhs of an assignment it forwards the object it is assigned to to the attribute, outsourcing to wrap the job of creating the SEXP from the input type

When the proxy is used on the rhs of the assignment, it retrieves the current value of the attribute and outsources to as the job of making an object of the appropriate type

Definition at line 119 of file RObject.h.


Constructor & Destructor Documentation

Rcpp::RObject::AttributeProxy::AttributeProxy ( const RObject v,
const std::string &  attr_name 
)
Parameters:
vobject of which we manipulate the attributes
attr_namename of the attribute the proxy manipulates

Definition at line 173 of file RObject.cpp.


Member Function Documentation

SEXP Rcpp::RObject::AttributeProxy::get ( ) const [private]

Definition at line 157 of file RObject.cpp.

Referenced by operator=().

template<typename T >
Rcpp::RObject::AttributeProxy::operator T ( ) const [inline]

rhs use. Retrieves the current value for the target attribute and structure it as a T object using as

Definition at line 149 of file RObject.h.

template<typename T >
AttributeProxy& Rcpp::RObject::AttributeProxy::operator= ( const T &  rhs) [inline]

lhs use. assigns the target attribute by wrapping the rhs object

Parameters:
rhswrappable object

Definition at line 140 of file RObject.h.

References Rcpp::wrap().

Here is the call graph for this function:

RObject::AttributeProxy & Rcpp::RObject::AttributeProxy::operator= ( const AttributeProxy rhs)

lhs use. This assigns the target attribute by using the current attribute referred by another proxy

Definition at line 176 of file RObject.cpp.

References get().

Here is the call graph for this function:

void Rcpp::RObject::AttributeProxy::set ( SEXP  x) const [private]

Definition at line 162 of file RObject.cpp.

References RCPP_DEBUG_1.


Member Data Documentation

Definition at line 155 of file RObject.h.

Definition at line 154 of file RObject.h.


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