Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

GarbageSafePointer Class Reference

#include <refcount.hpp>

Inheritance diagram for GarbageSafePointer:

Inheritance graph
[legend]
Collaboration diagram for GarbageSafePointer:

Collaboration graph
[legend]
List of all members.

Detailed Description

The smart pointer which performs reference-counting garbage collection.

The GarbageSafePointer is the class which encapsulates a pointer to an GarbageSafe object (constant or non-constant) and notifies the object about creation and disposion of the reference.

Note:
It is assumed that a plain pointer to an GarbageSafe object can exist only in one situation - when the object is created with operator new.
Warning:
User is strongly discouraged do declare pointers to GarbageSafe objects. PGarbageSafe should be used instead.

Definition at line 88 of file refcount.hpp.

Public Member Functions

 GarbageSafePointer ()
 Default constructor simply creates a NULL pointer.
 GarbageSafePointer (const GarbageSafe *pp)
 Construct from pointer.
 GarbageSafePointer (const GarbageSafePointer &other)
 Simply a copy constructor.
 ~GarbageSafePointer ()
 Destructor.
GarbageSafePointeroperator= (const GarbageSafePointer &other)
 Assign a value from another GarbageSafePointer.
GarbageSafePointeroperator= (GarbageSafe *pp)
 Assign a value of a plain pointer.
GarbageSafeGetPtr () const
 Get the pointer to the referenced object.


Constructor & Destructor Documentation

GarbageSafePointer::GarbageSafePointer  ) 
 

Default constructor simply creates a NULL pointer.

Definition at line 92 of file refcount.hpp.

GarbageSafePointer::GarbageSafePointer const GarbageSafe pp  ) 
 

Construct from pointer.

Definition at line 95 of file refcount.hpp.

References GarbageSafe::AddRef().

GarbageSafePointer::GarbageSafePointer const GarbageSafePointer other  ) 
 

Simply a copy constructor.

Definition at line 99 of file refcount.hpp.

References GarbageSafe::AddRef().

GarbageSafePointer::~GarbageSafePointer  ) 
 

Destructor.

Definition at line 103 of file refcount.hpp.

References GarbageSafe::Unlink().


Member Function Documentation

GarbageSafePointer& GarbageSafePointer::operator= const GarbageSafePointer other  ) 
 

Assign a value from another GarbageSafePointer.

We must increment the counter in this situation

Definition at line 108 of file refcount.hpp.

References GarbageSafe::AddRef(), and GarbageSafe::Unlink().

Referenced by GenericReference< SExpression >::operator=().

GarbageSafePointer& GarbageSafePointer::operator= GarbageSafe pp  ) 
 

Assign a value of a plain pointer.

Definition at line 117 of file refcount.hpp.

References GarbageSafe::AddRef(), and GarbageSafe::Unlink().

GarbageSafe* GarbageSafePointer::GetPtr  )  const
 

Get the pointer to the referenced object.

Reimplemented in GenericSReference< Tp, X_wrongtype >, GenericReference< Tp >, SBacklinkRef, SReference, SQueue, GenericSReference< SExpressionStream, IntelibX_not_a_stream >, GenericSReference< SchExpressionContext, IntelibX_scheme_not_a_context >, GenericSReference< SExpressionWrapper< Data >, IntelibX_wrong_expression_type >, GenericSReference< LExpressionSymbol, IntelibX_lisp_not_a_symbol >, GenericSReference< SExpressionDoubleList, IntelibX_not_a_doublelist >, GenericSReference< SExpressionString, IntelibX_not_a_string >, GenericSReference< SExpressionHashPackage, IntelibX_not_a_package >, GenericSReference< SExpressionVector, IntelibX_not_a_vector >, GenericSReference< SExpressionHashTable, IntelibX_not_a_hash_table >, GenericSReference< SchExpressionSymbol, IntelibX_scheme_not_a_symbol >, GenericSReference< LExpressionContext, IntelibX_lisp_not_a_context >, and GenericReference< SExpression >.

Definition at line 126 of file refcount.hpp.

Referenced by GenericReference< SExpression >::GetPtr().


The documentation for this class was generated from the following file:
Generated on Tue Dec 18 00:41:41 2007 for InteLib by  doxygen 1.4.1