CXXR (C++ R) API
|
General-purpose implementation of CXXR::Frame. More...
#include <StdFrame.hpp>
Public Member Functions | |
StdFrame (std::size_t initial_capacity=15) | |
Binding * | binding (const Symbol *symbol) |
Access binding of an already-defined Symbol. | |
const Binding * | binding (const Symbol *symbol) const |
Access const binding of an already-defined Symbol. | |
BindingRange | bindingRange () const |
Obtain a BindingRange for this Frame. | |
StdFrame * | clone () const |
Return pointer to a copy of this Frame. | |
void | lockBindings () |
Lock all Bindings in this Frame. | |
std::size_t | size () const |
Number of Bindings in Frame. | |
Public Member Functions inherited from CXXR::Frame | |
Frame (const Frame &source) | |
Copy constructor. | |
PairList * | asPairList () const |
Get contents as a PairList. | |
Binding * | bind (const Symbol *symbol, RObject *value, Frame::Binding::Origin origin=Frame::Binding::EXPLICIT) |
Bind a Symbol to a specified value. | |
void | clear () |
Remove all symbols from the Frame. | |
void | enableReadMonitoring (bool on) const |
Enable monitored reading of Symbol values. | |
void | enableWriteMonitoring (bool on) const |
Enable monitored writing of Symbol values. | |
bool | erase (const Symbol *symbol) |
Remove the Binding (if any) of a Symbol. | |
bool | isLocked () const |
Is the Frame locked? | |
void | lock (bool lock_bindings) |
Lock this Frame. | |
Binding * | obtainBinding (const Symbol *symbol) |
Get or create a Binding for a Symbol. | |
std::vector< const Symbol * > | symbols (bool include_dotsymbols) const |
Symbols bound by this Frame. | |
void | visitReferents (const_visitor *v) const |
Conduct a visitor to the nodes referred to by this one. | |
Public Member Functions inherited from CXXR::GCNode | |
void | expose () const |
Record that construction of a node is complete. | |
bool | isExposed () const |
Has this node been exposed to garbage collection? | |
Public Member Functions inherited from CXXR::HeterogeneousListBase::Link | |
Link () | |
Default constructor. | |
Link (HeterogeneousListBase *list) | |
Appending constructor. | |
void | freeLink () |
Detach Link from any list. |
Friends | |
class | boost::serialization::access |
Additional Inherited Members | |
Public Types inherited from CXXR::Frame | |
typedef boost::any_range < const Binding, boost::forward_traversal_tag, const Binding &, std::ptrdiff_t > | BindingRange |
Allow iteration over a Frame object's Bindings. | |
typedef void(* | monitor )(const Binding &) |
Function type for read and write monitors. | |
Static Public Member Functions inherited from CXXR::Frame | |
static monitor | setReadMonitor (monitor new_monitor) |
Define function to monitor reading of Symbol values. | |
static monitor | setWriteMonitor (monitor new_monitor) |
Define function to monitor writing of Symbol values. | |
Static Public Member Functions inherited from CXXR::GCNode | |
static void * | operator new (size_t bytes) |
Allocate memory. | |
static void * | operator new (size_t, void *where) |
Placement new for GCNode. | |
static void | operator delete (void *p, size_t bytes) |
Deallocate memory. | |
static bool | check () |
Integrity check. | |
template<class T > | |
static T * | expose (T *node) |
Record that construction of a node is complete. | |
static void | gc () |
Initiate a garbage collection. | |
static void | gclite () |
Lightweight garbage collection. | |
static void | maybeCheckExposed (const GCNode *node) |
Subject to configuration, check that a GCNode is exposed. | |
static size_t | numNodes () |
Number of GCNode objects in existence. | |
Protected Member Functions inherited from CXXR::Frame | |
void | statusChanged (const Symbol *sym) |
Report change in the bound/unbound status of Symbol objects. | |
void | detachReferents () |
Null out all references from this node to other nodes. | |
Protected Member Functions inherited from CXXR::GCNode | |
virtual | ~GCNode () |
Protected Member Functions inherited from CXXR::HeterogeneousListBase::Link | |
virtual | ~Link () |
General-purpose implementation of CXXR::Frame.
|
explicit |
initial_capacity | A hint to the implementation that the constructed StdFrame should be configured to have capacity for at least initial_capacity Bindings. This does not impose an upper limit on the capacity of the StdFrame, but some reconfiguration (and consequent time penalty) may occur if it is exceeded. |
Access binding of an already-defined Symbol.
This function provides a pointer to the Binding of a Symbol. In this variant the pointer is non-const, and consequently the calling code can use it to modify the Binding (provided the Binding is not locked).
symbol | The Symbol for which a mapping is sought. |
Implements CXXR::Frame.
Access const binding of an already-defined Symbol.
This function provides a pointer to a PairList element representing the binding of a symbol. In this variant the pointer is const, and consequently the calling code can use it only to examine the binding.
symbol | The Symbol for which a mapping is sought. |
Implements CXXR::Frame.
|
virtual |
Obtain a BindingRange for this Frame.
Implements CXXR::Frame.
|
virtual |
Return pointer to a copy of this Frame.
This function creates a copy of this Frame, and returns a pointer to that copy. The copy will define the same mapping from Symbols to R objects as this Frame; neither the R objects, nor of course the Symbols, are copied as part of the cloning.
The created copy will be locked if this Frame is locked. However, it will not have a read or write monitor.
Implements CXXR::Frame.
|
virtual |
Lock all Bindings in this Frame.
This operation affects only Bindings currently existing. It does not prevent Bindings being added subsequently, and such Bindings will not be locked.
It is permitted to apply this function to a locked Frame.
Implements CXXR::Frame.
|
virtual |
Number of Bindings in Frame.
Implements CXXR::Frame.