CXXR (C++ R)
|
Smart pointer used to control the copying of RObjects. More...
#include <RHandle.hpp>
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 |
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.
|
inlineexplicit |
Primary constructor.
target | Pointer to the object to which this RHandle is to refer. |
|
inline |
Copy constructor.
pattern | RHandle 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. |
|
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 >.