CXXR (C++ R)
Public Types | Public Member Functions
CXXR::GCEdge< T > Class Template Reference

Directed edge in the graph whose nodes are GCNode objects. More...

#include <GCEdge.hpp>

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

List of all members.

Public Types

typedef T type

Public Member Functions

 GCEdge (T *target)
 Primary constructor.
 GCEdge (const GCEdge< T > &source)
 Copy constructor.
GCEdge< T > & operator= (const GCEdge< T > &source)
GCEdge< T > & operator= (T *newtarget)
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

- Protected Member Functions inherited from CXXR::GCEdgeBase
 GCEdgeBase (const GCNode *target)
 Primary constructor.
 GCEdgeBase (const GCEdgeBase &source)
 Copy constructor.
const GCNodetarget () const
 Get target of this edge.
void retarget (const GCNode *newtarget)
 Redirect the GCEdge to point at a (possibly) different node.

Detailed Description

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

Directed edge in the graph whose nodes are GCNode objects.

This class encapsulates a pointer from one GCNode to another, and carries out housekeeping required by the garbage collection scheme. The class name reflects the fact that these objects represent directed edges in the directed graph with the GCNode objects as its nodes.

Whenever an object of a type derived from GCNode needs to refer to another such object, it should do so by containing a GCEdge object, rather than by containing a pointer or reference directly.

Template Parameters:
TGCNode or a type publicly derived from GCNode. This may be qualified by const, so for example a const String* may be encapsulated in a GCEdge using the type GCEdge<const String>.

Constructor & Destructor Documentation

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

Primary constructor.

Parameters:
targetPointer to the object to which this GCEdge is to refer. A null pointer is permissible.
template<class T = RObject>
CXXR::GCEdge< T >::GCEdge ( const GCEdge< T > &  source)
inline

Copy constructor.

Parameters:
sourceGCEdge to be copied. The constructed GCEdge will point to the same object (if any) as source.

Member Function Documentation

template<class T = RObject>
T* CXXR::GCEdge< T >::get ( ) const
inline

Access the target pointer.

Returns:
pointer to the current target (if any) of the edge.
template<class T = RObject>
CXXR::GCEdge< T >::operator T * ( ) const
inline

Extract encapsulated pointer.

Returns:
The encapsulated pointer.

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