CXXR (C++ R)
Public Member Functions | Static Public Member Functions
CXXR::FunctionContext Class Reference

Context recording the invocation of a FunctionBase. More...

#include <FunctionContext.hpp>

Inheritance diagram for CXXR::FunctionContext:
Inheritance graph
[legend]
Collaboration diagram for CXXR::FunctionContext:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 FunctionContext (const Expression *the_call, Environment *call_env, const FunctionBase *function)
 Constructor.
const Expressioncall () const
 The call of the Context.
EnvironmentcallEnvironment () const
 The call Environment.
const FunctionBasefunction () const
 Function being applied.
RObjectsourceLocation () const
 Source location associated with this Context.
- Public Member Functions inherited from CXXR::Evaluator::Context
ContextnextOut () const
 Next Context out.
Type type () const
 Type of the Context.

Static Public Member Functions

static FunctionContextinnermost (Evaluator::Context *start=Evaluator::Context::innermost())
 Search outwards for a FunctionContext.
- Static Public Member Functions inherited from CXXR::Evaluator::Context
static Contextinnermost ()
 The innermost Context.

Additional Inherited Members

- Public Types inherited from CXXR::Evaluator::Context
enum  Type { BAILOUT = 0, PLAIN, FUNCTION, CLOSURE }
 Context types. More...
- Protected Member Functions inherited from CXXR::Evaluator::Context
void setType (Type the_type)
 Set the type of the Context.

Detailed Description

Context recording the invocation of a FunctionBase.

This class is the base class of ClosureContext. A FunctionContext object that is not also a ClosureContext records the invocation of a BuiltInFunction.

Note that as in CR, calls to 'special' BuiltInFunction objects (SPECIALSXP) are not recorded; however, unlike CR, calls to other BuiltInFunction objects (BUILTINSXP) are always recorded.


Constructor & Destructor Documentation

FunctionContext::FunctionContext ( const Expression the_call,
Environment call_env,
const FunctionBase function 
)

Constructor.

Parameters:
the_callPointer to the call with which this Context is associated.
call_envPointer to the Environment in which the_call is to be evaluated.
functionPointer, possibly null, to the function being applied.

Member Function Documentation

const Expression* CXXR::FunctionContext::call ( ) const
inline

The call of the Context.

Returns:
Pointer to the call with which the Context is associated.
Environment* CXXR::FunctionContext::callEnvironment ( ) const
inline

The call Environment.

Returns:
Pointer to the Environment in which the Context's call is to be evaluated.
const FunctionBase* CXXR::FunctionContext::function ( ) const
inline

Function being applied.

Returns:
Pointer, possibly null, to the function being applied in this Context.
FunctionContext * FunctionContext::innermost ( Evaluator::Context start = Evaluator::Context::innermost())
static

Search outwards for a FunctionContext.

This function works outwards from the Evaluator::Context start until it finds a FunctionContext (possibly start itself), and returns a pointer to that FunctionContext.

Parameters:
startThe Evaluator::Context from which the search is to start.
Returns:
Pointer to the innermost FunctionContext found, or a null pointer if no such context was found.

Reimplemented in CXXR::ClosureContext.

RObject* CXXR::FunctionContext::sourceLocation ( ) const
inline

Source location associated with this Context.

Returns:
Pointer, possibly null, to the source location associated with this Context.

The documentation for this class was generated from the following files: