Rcpp Version 0.9.10
Rcpp::RObject::SlotProxy Class Reference

#include <RObject.h>

Collaboration diagram for Rcpp::RObject::SlotProxy:

List of all members.

Public Member Functions

 SlotProxy (const RObject &v, const std::string &name)
SlotProxyoperator= (const SlotProxy &rhs)
template<typename T >
SlotProxyoperator= (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 slot_name

Detailed Description

Proxy for objects slots.

Definition at line 164 of file RObject.h.


Constructor & Destructor Documentation

Rcpp::RObject::SlotProxy::SlotProxy ( const RObject v,
const std::string &  name 
)

Creates a slot proxy. This throws an exception if the parent object is not an S4 object or if the class of parent object does not have the requested slot

Parameters:
vparent object of which we get/set a slot
nameslot name

Definition at line 129 of file RObject.cpp.


Member Function Documentation

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

Definition at line 144 of file RObject.cpp.

Referenced by operator=().

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

rhs use. Retrieves the current value of the slot and structures it as a T object. This only works when as<T> makes sense

Definition at line 200 of file RObject.h.

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

lhs use. Assigns the slot by wrapping the rhs object

Parameters:
rhswrappable object

Definition at line 190 of file RObject.h.

References Rcpp::wrap().

Here is the call graph for this function:

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

lhs use. Assigns the target slot using the current value of another slot proxy.

Parameters:
rhsanother slot proxy

Definition at line 138 of file RObject.cpp.

References get().

Here is the call graph for this function:

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

Definition at line 149 of file RObject.cpp.

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

Here is the call graph for this function:


Member Data Documentation

Definition at line 205 of file RObject.h.

std::string Rcpp::RObject::SlotProxy::slot_name [private]

Definition at line 206 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