CXXR (C++ R) API
|
Framework for R command evaluation. More...
#include <Evaluator.h>
Classes | |
class | Context |
Housekeeping information on R call stack. More... |
Public Member Functions | |
Context * | innermostContext () const |
Innermost Context belonging to this Evaluator. |
Static Public Member Functions | |
static Evaluator * | current () |
The current Evaluator. | |
static unsigned int | depth () |
(Not for general use.) | |
static unsigned int | depthLimit () |
Maximum depth of R expression nesting. | |
static void | enableExtraDepth (bool on) |
(Not for general use.) | |
static void | enableProfiling (bool on) |
(Not for general use.) | |
static void | enableResultPrinting (bool on) |
Specify whether the result of top-level expression be printed. | |
static RObject * | evaluate (RObject *object, Environment *env) |
Evaluate RObject in a specified Environment. | |
static bool | profiling () |
Is profiling currently enabled? | |
static bool | resultPrinted () |
Is the result of top-level expression evaluation printed? | |
static void | setDepth (unsigned int depth) |
(Not for general use.) | |
static void | setDepthLimit (int depth) |
Set maximum depth of R expression nesting. |
Friends | |
class | Context |
Framework for R command evaluation.
An object of this class provides a framework within which evaluation of R commands (i.e. top-level R expressions) takes place, and provides various housekeeping services to control and support that evaluation. Evaluator objects conceptually form a stack, so they must be destroyed in the reverse order of creation: it is therefore recommended that they always be declared on the processor stack, i.e. as C++ automatic variables. The Evaluator at the top of the stack is the current Evaluator.
If an error occurs during R expression evaluation, the resulting exception is caught within the scope of the current Evaluator; the relevant code will then typically request another R command (if interactive), or terminate the scope of the current Evaluator, thus popping it off the Evaluator stack, and return control to code within the scope of the next Evaluator down.
Each Evaluator object contains a nested sequence of zero or more Contexts. A newly created Context is added to the sequence belonging to the current Evaluator. It is therefore an error to declare a Context object outside the scope of any Evaluator object.
|
inlinestatic |
|
inlinestatic |
(Not for general use.)
Used in context.cpp to save the evaluation depth associated with an RCNTXT. Also used in do_Cstack_info() in platform.cpp.
|
inlinestatic |
Maximum depth of R expression nesting.
|
inlinestatic |
(Not for general use.)
on | If true, and extra depth is not already enabled, an increase is applied to the permissible depth of nested evaluations to allow error reporting to be carried out. If false, any such extra depth currently in force is removed. |
|
inlinestatic |
(Not for general use.)
This function is for use by the profiling code in eval.cpp to record whether profiling is currently enabled.
on | true iff printing is required. |
|
inlinestatic |
Specify whether the result of top-level expression be printed.
on | true iff printing is required. |
|
static |
Evaluate RObject in a specified Environment.
For most types of RObject, this simply returns a pointer to the RObject itself.
object | Pointer to the RObject to be evaluated. May be null, in which case the function returns a null pointer. |
env | Pointer to the environment in which evaluation is to take place. May be null only if object is null. |
|
inline |
|
inlinestatic |
Is profiling currently enabled?
|
inlinestatic |
Is the result of top-level expression evaluation printed?
|
inlinestatic |
(Not for general use.)
Used in context.cpp to restore the evaluation depth associated with an RCNTXT. Also used in main.cpp to reset the evaluation depth to zero.
depth | The required depth. |
|
static |
Set maximum depth of R expression nesting.
depth | The required maximum nesting depth. If the supplied value lies outside the permissible range, an error is reported and the nesting depth is left unchanged. |