CXXR (C++ R) API
Public Member Functions
CXXR::RHandle< T > Class Template Reference

Smart pointer used to control the copying of RObjects. More...

#include <RHandle.hpp>

Inheritance diagram for CXXR::RHandle< T >:
Inheritance graph
[legend]
Collaboration diagram for CXXR::RHandle< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 RHandle (T *target)
 Primary constructor.
 RHandle (const RHandle< T > &pattern)
 Copy constructor.
RHandle< T > & operator= (const RHandle< T > &source)
 Assignment operator.
RHandle< T > & operator= (T *newtarget)
 Assignment from pointer.
- Public Member Functions inherited from CXXR::GCEdge< T >
 GCEdge (T *target)
 Primary constructor.
 GCEdge (const GCEdge< T > &source)
 Copy constructor.
GCEdge< T > & operator= (const GCEdge< T > &source)
T * operator-> () const
 operator T * () const
 Extract encapsulated pointer.
T * get () const
 Access the target pointer.
- Public Member Functions inherited from CXXR::GCEdgeBase
void detach ()
 Null the encapsulated pointer.

Additional Inherited Members

- Public Types inherited from CXXR::GCEdge< T >
typedef T type

Detailed Description

template<class T = RObject>
class CXXR::RHandle< T >

Smart pointer used to control the copying of RObjects.

This class encapsulates a T* pointer, where T is derived from RObject, and is used to manage the copying of subobjects when an RObject is copied. For most purposes, it behaves essentially like a GCEdge<T>. However, when a RHandle is copied, it checks whether the object, x say, that it points to is clonable. If it is, then the copied RHandle will point to a clone of x ; if not, then the copy will point to x itself.

Parameters:
TRObject or a class publicly derived from RObject.

Constructor & Destructor Documentation

template<class T = RObject>
CXXR::RHandle< T >::RHandle ( T *  target)
inlineexplicit

Primary constructor.

Parameters:
targetPointer to the object to which this RHandle is to refer.
template<class T = RObject>
CXXR::RHandle< T >::RHandle ( const RHandle< T > &  pattern)
inline

Copy constructor.

Parameters:
patternRHandle to be copied. Suppose pattern points to an object x . If x is clonable object, i.e. an object of a class that non-trivially implements RObject::clone(), then the newly created RHandle will point to a clone of x ; otherwise it will point to x itself. If pattern encapsulates a null pointer, so will the created object.

Member Function Documentation

template<class T = RObject>
RHandle<T>& CXXR::RHandle< T >::operator= ( T *  newtarget)
inline

Assignment from pointer.

Note that this does not attempt to clone newtarget: it merely changes this RHandle to point to newtarget.

Reimplemented from CXXR::GCEdge< T >.


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