|
Rcpp Version 0.9.10
|
#include <RObject.h>

Classes | |
| class | AttributeProxy |
| class | SlotProxy |
Public Member Functions | |
| RObject () | |
| RObject (SEXP x) | |
| RObject (const RObject &other) | |
| RObject & | operator= (const RObject &other) |
| RObject & | operator= (SEXP other) |
| virtual | ~RObject () |
| operator SEXP () const | |
| bool | inherits (const char *clazz) const |
| std::vector< std::string > | attributeNames () const |
| bool | hasAttribute (const std::string &attr) const |
| AttributeProxy | attr (const std::string &name) const |
| bool | isNULL () const |
| int | sexp_type () const |
| SEXP | asSexp () const |
| bool | isObject () const |
| bool | isS4 () const |
| bool | hasSlot (const std::string &name) const |
| SlotProxy | slot (const std::string &name) const |
Protected Member Functions | |
| void | setSEXP (SEXP x) |
Protected Attributes | |
| SEXP | m_sexp |
Private Member Functions | |
| void | preserve () |
| void | release () |
| virtual void | update () |
Friends | |
| class | SlotProxy |
| Rcpp::RObject::RObject | ( | ) | [inline] |
| Rcpp::RObject::RObject | ( | SEXP | x | ) | [inline] |
| Rcpp::RObject::RObject | ( | const RObject & | other | ) |
Copy constructor. set this SEXP to the SEXP of the copied object
Definition at line 85 of file RObject.cpp.
References asSexp(), setSEXP(), and x.

| Rcpp::RObject::~RObject | ( | ) | [virtual] |
Removes the protection. The enclosed SEXP becomes subject to garbage collection, if not otherwise protected
Definition at line 101 of file RObject.cpp.
References logTxt, and release().

| SEXP Rcpp::RObject::asSexp | ( | ) | const [inline] |
explicit conversion to SEXP
Definition at line 244 of file RObject.h.
References m_sexp.
Referenced by Rcpp::CppClass::CppClass(), Rcpp::DottedPair::DottedPair(), Rcpp::Environment::Environment(), Rcpp::Function::Function(), Rcpp::Reference::FieldProxy::get(), Rcpp::XPtr< T, Finalizer >::ProtectedProxy::get(), Rcpp::XPtr< T, Finalizer >::TagProxy::get(), Rcpp::Language::Language(), Rcpp::WeakReference::operator=(), Rcpp::Symbol::operator=(), Rcpp::S4::operator=(), operator=(), Rcpp::Reference::operator=(), Rcpp::Promise::operator=(), Rcpp::Pairlist::operator=(), Rcpp::Language::operator=(), Rcpp::Function::operator=(), Rcpp::Formula::operator=(), Rcpp::Environment::operator=(), Rcpp::DottedPair::operator=(), Rcpp::XPtr< T, Finalizer >::operator=(), Rcpp::Pairlist::Pairlist(), Rcpp::Promise::Promise(), Rcpp::Reference::Reference(), RObject(), Rcpp::S4::S4(), Rcpp::Reference::FieldProxy::set(), Rcpp::XPtr< T, Finalizer >::ProtectedProxy::set(), Rcpp::XPtr< T, Finalizer >::TagProxy::set(), and Rcpp::Symbol::Symbol().
| RObject::AttributeProxy Rcpp::RObject::attr | ( | const std::string & | name | ) | const |
extract or set the given attribute
| name | name of the attribute to get/set |
RObject y = x.attr("foo") ; // rhs : get the attribute x.attr( "bar" ) = 10 ; // lhs : set the attribute.
wrap is called on the right side of the assignment it can be anything wrap can handle.
Definition at line 181 of file RObject.cpp.
Referenced by Rcpp::S4::is().
| std::vector< std::string > Rcpp::RObject::attributeNames | ( | ) | const |
extracts the names of the attributes of the wrapped SEXP
Definition at line 106 of file RObject.cpp.
References m_sexp, R_NilValue, and v.
| bool Rcpp::RObject::hasAttribute | ( | const std::string & | attr | ) | const |
Identifies if the SEXP has the given attribute
Definition at line 118 of file RObject.cpp.
References m_sexp, and R_NilValue.
| bool Rcpp::RObject::hasSlot | ( | const std::string & | name | ) | const |
Indicates if this S4 object has the given slot
| not_s4 | if the object is not an S4 object |
Definition at line 187 of file RObject.cpp.
References m_sexp.
| bool Rcpp::RObject::inherits | ( | const char * | clazz | ) | const [inline] |
| bool Rcpp::RObject::isNULL | ( | ) | const [inline] |
is this object NULL
Definition at line 234 of file RObject.h.
References m_sexp.
Referenced by Rcpp::DottedPair::insert(), and Rcpp::DottedPair::push_back().
| bool Rcpp::RObject::isObject | ( | ) | const [inline] |
| bool Rcpp::RObject::isS4 | ( | ) | const [inline] |
| Rcpp::RObject::operator SEXP | ( | ) | const [inline] |
| RObject & Rcpp::RObject::operator= | ( | SEXP | other | ) |
Assignement operator. Set this SEXP to the given SEXP
Reimplemented in Rcpp::Reference, and Rcpp::S4.
Definition at line 96 of file RObject.cpp.
References setSEXP().

Assignment operator. set this SEXP to the SEXP of the copied object
Definition at line 90 of file RObject.cpp.
References asSexp(), setSEXP(), and x.

| void Rcpp::RObject::preserve | ( | ) | [inline, private] |
Definition at line 291 of file RObject.h.
References m_sexp, and R_NilValue.
Referenced by setSEXP().
| void Rcpp::RObject::release | ( | ) | [inline, private] |
Definition at line 292 of file RObject.h.
References m_sexp, and R_NilValue.
Referenced by setSEXP(), and ~RObject().
| void Rcpp::RObject::setSEXP | ( | SEXP | x | ) | [protected] |
sets the SEXP wrapped by this object
| x | new SEXP to attach to this object |
Definition at line 65 of file RObject.cpp.
References m_sexp, preserve(), RCPP_DEBUG_1, release(), update(), and x.
Referenced by Rcpp::DottedPair::DottedPair(), Rcpp::Environment::Environment(), Rcpp::Formula::Formula(), Rcpp::Function::Function(), Rcpp::Language::Language(), Rcpp::WeakReference::operator=(), Rcpp::Symbol::operator=(), Rcpp::S4::operator=(), operator=(), Rcpp::Reference::operator=(), Rcpp::Promise::operator=(), Rcpp::Pairlist::operator=(), Rcpp::Language::operator=(), Rcpp::Function::operator=(), Rcpp::Formula::operator=(), Rcpp::Environment::operator=(), Rcpp::DottedPair::operator=(), Rcpp::XPtr< T, Finalizer >::operator=(), Rcpp::Pairlist::Pairlist(), Rcpp::Promise::Promise(), Rcpp::DottedPair::push_back(), Rcpp::DottedPair::push_front(), Rcpp::Reference::Reference(), Rcpp::DottedPair::remove(), RObject(), Rcpp::S4::S4(), Rcpp::S4::set(), Rcpp::RObject::SlotProxy::set(), Rcpp::Reference::FieldProxy::set(), Rcpp::Reference::set(), Rcpp::InternalFunction::set(), Rcpp::Symbol::Symbol(), Rcpp::WeakReference::WeakReference(), and Rcpp::XPtr< T, Finalizer >::XPtr().

| int Rcpp::RObject::sexp_type | ( | ) | const [inline] |
| RObject::SlotProxy Rcpp::RObject::slot | ( | const std::string & | name | ) | const |
Retrieves the given slot
| not_s4 | if this is not an S4 object |
Definition at line 192 of file RObject.cpp.
References m_sexp, and SlotProxy.
Referenced by Rcpp::CppClass::CppClass(), and Rcpp::CppObject::CppObject().
| virtual void Rcpp::RObject::update | ( | ) | [inline, private, virtual] |
Reimplemented in Rcpp::Language.
Definition at line 294 of file RObject.h.
References m_sexp, and RCPP_DEBUG_1.
Referenced by setSEXP().
SEXP Rcpp::RObject::m_sexp [protected] |
The SEXP this is wrapping. This has to be considered read only. to change it, use setSEXP
Definition at line 283 of file RObject.h.
Referenced by asSexp(), Rcpp::Environment::assign(), attributeNames(), Rcpp::Environment::bindingIsActive(), Rcpp::Environment::bindingIsLocked(), Rcpp::Function::body(), Rcpp::Symbol::c_str(), Rcpp::Promise::environment(), Rcpp::Function::environment(), Rcpp::Language::eval(), Rcpp::Environment::exists(), Rcpp::Promise::expression(), Rcpp::Environment::find(), Rcpp::Environment::get(), hasAttribute(), hasSlot(), inherits(), Rcpp::DottedPair::insert(), Rcpp::Environment::is_user_database(), Rcpp::Environment::isLocked(), isNULL(), isObject(), isS4(), Rcpp::WeakReference::key(), Rcpp::DottedPair::length(), Rcpp::Environment::lock(), Rcpp::Environment::lockBinding(), Rcpp::Environment::ls(), Rcpp::Environment::new_child(), operator SEXP(), Rcpp::XPtr< T, Finalizer >::operator T *(), Rcpp::Function::operator()(), Rcpp::XPtr< T, Finalizer >::operator*(), Rcpp::XPtr< T, Finalizer >::operator->(), Rcpp::Environment::parent(), preserve(), Rcpp::DottedPair::push_back(), Rcpp::DottedPair::push_front(), release(), Rcpp::Environment::remove(), Rcpp::DottedPair::remove(), Rcpp::DottedPair::replace(), Rcpp::Promise::seen(), Rcpp::XPtr< T, Finalizer >::setDeleteFinalizer(), Rcpp::Language::setFunction(), setSEXP(), Rcpp::Language::setSymbol(), sexp_type(), Rcpp::DottedPair::size(), slot(), Rcpp::Environment::unlockBinding(), Rcpp::Language::update(), update(), Rcpp::WeakReference::value(), Rcpp::Promise::value(), and Rcpp::Promise::was_evaluated().