CXXR (C++ R)
Classes | Namespaces | Macros | Functions
Promise.h File Reference

($Id: Promise.h 1353 2013-03-18 16:59:38Z arr $)

Class CXXR::Promise and associated C interface. More...

#include "CXXR/RObject.h"
#include "CXXR/Evaluator.h"
#include <boost/serialization/access.hpp>
#include <boost/serialization/base_object.hpp>
#include <boost/serialization/nvp.hpp>
#include "CXXR/Expression.h"
#include "CXXR/Environment.h"
#include "CXXR/Symbol.h"
Include dependency graph for Promise.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CXXR::Promise
 Mechanism for deferred evaluation. More...

Namespaces

namespace  CXXR
 Namespace for the CXXR project.

Macros

#define PREXPR(e)   PRCODE(e)

Functions

RObjectCXXR::forceIfPromise (RObject *object)
 Use forced value if RObject is a Promise.
template<class Archive >
void boost::serialization::load_construct_data (Archive &ar, CXXR::Promise *t, const unsigned int version)
 Template specialisation.
template<class Archive >
void boost::serialization::save_construct_data (Archive &ar, const CXXR::Promise *t, const unsigned int version)
 Template specialisation.
SEXP Rf_mkPROMISE (SEXP expr, SEXP env)
 Create a CXXR::Promise object.
SEXP PRCODE (SEXP x)
 Access the expression of a CXXR::Promise.
SEXP PRENV (SEXP x)
 Access the environment of a CXXR::Promise.
SEXP PRVALUE (SEXP x)
 Access the value of a CXXR::Promise.
void SET_PRVALUE (SEXP x, SEXP v)
 Set the value of a CXXR::Promise.

Detailed Description

Class CXXR::Promise and associated C interface.


Function Documentation

SEXP PRCODE ( SEXP  x)
inline

Access the expression of a CXXR::Promise.

Parameters:
xPointer to a CXXR::Promise (checked).
Returns:
Pointer to the expression to be evaluated by the CXXR::Promise.
SEXP PRENV ( SEXP  x)
inline

Access the environment of a CXXR::Promise.

Parameters:
xPointer to a CXXR::Promise (checked).
Returns:
Pointer to the environment in which the CXXR::Promise is to be evaluated. Set to a null pointer when the CXXR::Promise has been evaluated.
SEXP PRVALUE ( SEXP  x)
inline

Access the value of a CXXR::Promise.

Parameters:
xPointer to a CXXR::Promise (checked).
Returns:
Pointer to the value of the CXXR::Promise, or to R_UnboundValue if it has not yet been evaluated..
SEXP Rf_mkPROMISE ( SEXP  expr,
SEXP  env 
)

Create a CXXR::Promise object.

Parameters:
exprExpression to be evaluated to provide the value of the CXXR::Promise.
envCXXR::Environment in which expr is to be evaluated.
void SET_PRVALUE ( SEXP  x,
SEXP  v 
)

Set the value of a CXXR::Promise.

Once the value is set to something other than R_UnboundValue, the environment pointer is set null.

Parameters:
xPointer to a CXXR::Promise (checked).
vPointer to the value to be assigned to the promise.
Todo:
Replace this with a method call to evaluate the promise.