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


Classes | |
| class | Binding |
Public Member Functions | |
| const Binding | operator[] (const std::string &name) const |
| Binding | operator[] (const std::string &name) |
| Environment () | |
| Environment (SEXP x) | |
| Environment (const Environment &other) | |
| Environment & | operator= (const Environment &other) |
| Environment (const std::string &name) | |
| Environment (int pos) | |
| ~Environment () | |
| SEXP | ls (bool all) const |
| SEXP | get (const std::string &name) const |
| SEXP | find (const std::string &name) const |
| bool | exists (const std::string &name) const |
| bool | assign (const std::string &name, SEXP x) const |
| template<typename WRAPPABLE > | |
| bool | assign (const std::string &name, const WRAPPABLE &x) const |
| bool | isLocked () const |
| bool | remove (const std::string &name) |
| void | lock (bool bindings) |
| void | lockBinding (const std::string &name) |
| void | unlockBinding (const std::string &name) |
| bool | bindingIsLocked (const std::string &name) const |
| bool | bindingIsActive (const std::string &name) const |
| bool | is_user_database () const |
| Environment | parent () const |
| Environment | new_child (bool hashed) |
Static Public Member Functions | |
| static Environment | global_env () |
| static Environment | empty_env () |
| static Environment | base_env () |
| static Environment | base_namespace () |
| static Environment | Rcpp_namespace () |
| static Environment | namespace_env (const std::string &) |
Friends | |
| class | Binding |
Definition at line 35 of file Environment.h.
| Rcpp::Environment::Environment | ( | ) |
Definition at line 26 of file Environment.cpp.
Referenced by base_env(), base_namespace(), empty_env(), global_env(), namespace_env(), new_child(), and parent().
| Rcpp::Environment::Environment | ( | SEXP | x = R_GlobalEnv | ) |
wraps the given environment
if the SEXP is not an environment, and exception is thrown
Definition at line 28 of file Environment.cpp.
References Rcpp::Evaluator::run(), Rcpp::RObject::setSEXP(), and x.

| Rcpp::Environment::Environment | ( | const Environment & | other | ) |
copy constructor
Definition at line 71 of file Environment.cpp.
References Rcpp::RObject::asSexp(), and Rcpp::RObject::setSEXP().

| Rcpp::Environment::Environment | ( | const std::string & | name | ) |
Gets the environment associated with the given name
| name | name of the environment, e.g "package:Rcpp" |
Definition at line 42 of file Environment.cpp.
References R_NilValue, Rcpp::Evaluator::run(), and Rcpp::RObject::setSEXP().

| Rcpp::Environment::Environment | ( | int | pos | ) |
Gets the environment in the given position of the search path
| pos | (1-based) position of the environment, e.g pos=1 gives the global environment |
Definition at line 60 of file Environment.cpp.
References Rcpp::Evaluator::run(), and Rcpp::RObject::setSEXP().

| Rcpp::Environment::~Environment | ( | ) |
| bool Rcpp::Environment::assign | ( | const std::string & | name, |
| SEXP | x = R_NilValue |
||
| ) | const |
Attempts to assign x to name in this environment
| name | name of the object to assign |
| x | object to assign |
| binding_is_locked | if the binding is locked |
Definition at line 128 of file Environment.cpp.
References bindingIsLocked(), exists(), Rcpp::RObject::m_sexp, and x.
Referenced by assign(), and Rcpp::Environment::Binding::operator=().

| bool Rcpp::Environment::assign | ( | const std::string & | name, |
| const WRAPPABLE & | x | ||
| ) | const [inline] |
wrap and assign. If there is a wrap method taking an object of WRAPPABLE type, then it is wrapped and the corresponding SEXP is assigned in the environment
| name | name of the object to assign |
| x | wrappable object. anything that has a wrap( WRAPPABLE ) is fine |
Definition at line 269 of file Environment.h.
References assign(), and Rcpp::wrap().

| Environment Rcpp::Environment::base_env | ( | ) | [static] |
Definition at line 201 of file Environment.cpp.
References Environment().

| Environment Rcpp::Environment::base_namespace | ( | ) | [static] |
Definition at line 205 of file Environment.cpp.
References Environment().

| bool Rcpp::Environment::bindingIsActive | ( | const std::string & | name | ) | const |
| name | name of a binding |
| no_such_binding | if there is no such binding in this environment |
Definition at line 159 of file Environment.cpp.
References exists(), and Rcpp::RObject::m_sexp.

| bool Rcpp::Environment::bindingIsLocked | ( | const std::string & | name | ) | const |
| name | name of a potential binding |
| no_such_binding | if there is no such binding in this environment |
Definition at line 165 of file Environment.cpp.
References exists(), and Rcpp::RObject::m_sexp.
Referenced by assign(), and remove().

| Environment Rcpp::Environment::empty_env | ( | ) | [static] |
Definition at line 197 of file Environment.cpp.
References Environment().

| bool Rcpp::Environment::exists | ( | const std::string & | name | ) | const |
Indicates if an object called name exists in the environment
| name | name of the object |
Definition at line 122 of file Environment.cpp.
References Rcpp::RObject::m_sexp.
Referenced by assign(), bindingIsActive(), bindingIsLocked(), lockBinding(), remove(), and unlockBinding().
| SEXP Rcpp::Environment::find | ( | const std::string & | name | ) | const |
Get an object from the environment or one of its parents
| name | name of the object |
Definition at line 109 of file Environment.cpp.
References Rcpp::RObject::m_sexp.
| SEXP Rcpp::Environment::get | ( | const std::string & | name | ) | const |
Get an object from the environment
| name | name of the object |
Definition at line 96 of file Environment.cpp.
References Rcpp::RObject::m_sexp, and R_NilValue.
Referenced by Rcpp::Environment::Binding::operator T(), and Rcpp::Environment::Binding::operator=().
| Environment Rcpp::Environment::global_env | ( | ) | [static] |
Definition at line 193 of file Environment.cpp.
References Environment().

| bool Rcpp::Environment::is_user_database | ( | ) | const |
Indicates if this is a user defined database.
Definition at line 187 of file Environment.cpp.
References Rcpp::RObject::m_sexp.
Referenced by ls().
| bool Rcpp::Environment::isLocked | ( | ) | const |
Definition at line 155 of file Environment.cpp.
References Rcpp::RObject::m_sexp.
| void Rcpp::Environment::lock | ( | bool | bindings = false | ) |
locks this environment. See ?lockEnvironment
| bindings | also lock the bindings of this environment ? |
Definition at line 171 of file Environment.cpp.
References Rcpp::RObject::m_sexp.
| void Rcpp::Environment::lockBinding | ( | const std::string & | name | ) |
Locks the given binding in the environment. see ?bindingIsLocked
| no_such_binding | if there is no such binding in this environment |
Definition at line 175 of file Environment.cpp.
References exists(), and Rcpp::RObject::m_sexp.

| SEXP Rcpp::Environment::ls | ( | bool | all = true | ) | const |
The list of objects in the environment
the same as calling this from R: > ls( envir = this, all = all )
| all | same meaning as in ?ls |
Definition at line 84 of file Environment.cpp.
References Rcpp::all(), is_user_database(), Rcpp::RObject::m_sexp, and R_NilValue.

| Environment Rcpp::Environment::namespace_env | ( | const std::string & | package | ) | [static] |
| name | the name of the package of which we want the namespace |
| no_such_namespace |
Definition at line 209 of file Environment.cpp.
References Environment(), R_NilValue, and Rcpp::Evaluator::run().

| Environment Rcpp::Environment::new_child | ( | bool | hashed | ) |
creates a new environment whose this is the parent
Definition at line 270 of file Environment.cpp.
References Environment(), Rcpp::RObject::m_sexp, and Rcpp::Evaluator::run().

| Environment & Rcpp::Environment::operator= | ( | const Environment & | other | ) |
assignment
Definition at line 75 of file Environment.cpp.
References Rcpp::RObject::asSexp(), and Rcpp::RObject::setSEXP().

| Environment::Binding Rcpp::Environment::operator[] | ( | const std::string & | name | ) |
Same as above, but for a non-const Environment
Definition at line 262 of file Environment.cpp.
References Binding.
| const Environment::Binding Rcpp::Environment::operator[] | ( | const std::string & | name | ) | const |
Creates a binding for a variable in this environment
The Binding class is a proxy class, so depending on how the result of this operator call is used, the variable is either retrieved or modified. See the Binding class for details
Definition at line 258 of file Environment.cpp.
References Binding.
| Environment Rcpp::Environment::parent | ( | ) | const |
The parent environment of this environment
Definition at line 221 of file Environment.cpp.
References Environment(), and Rcpp::RObject::m_sexp.

| Environment Rcpp::Environment::Rcpp_namespace | ( | ) | [static] |
Definition at line 266 of file Environment.cpp.
References Rcpp::internal::get_Rcpp_namespace().
Referenced by Rcpp::internal::make_new_object(), Rcpp::Evaluator::run(), and Rcpp::InternalFunction::set().

| bool Rcpp::Environment::remove | ( | const std::string & | name | ) |
remove an object from this environment
Definition at line 135 of file Environment.cpp.
References bindingIsLocked(), exists(), Rcpp::RObject::m_sexp, and PROTECT().

| void Rcpp::Environment::unlockBinding | ( | const std::string & | name | ) |
unlocks the given binding see ?bindingIsLocked
| no_such_binding | if there is no such binding in this environment |
Definition at line 181 of file Environment.cpp.
References exists(), and Rcpp::RObject::m_sexp.

friend class Binding [friend] |
Definition at line 168 of file Environment.h.
Referenced by operator[]().