Dune::SmartPointer< T > Class Template Reference
[Common (foundation classes)]

A reference counting smart pointer. More...

#include <dune/common/smartpointer.hh>

List of all members.

Classes

class  PointerRep
 The object we reference.

Public Types

typedef T MemberType
 The data type we are a pointer for.

Public Member Functions

 SmartPointer ()
 Constructs a new smart pointer and allocates the referenced Object.
 SmartPointer (T *pointer)
 Constructs a new smart pointer from a preallocated Object.
 SmartPointer (const SmartPointer< T > &pointer)
 Copy constructor.
 ~SmartPointer ()
 Destructor.
SmartPointeroperator= (const SmartPointer< T > &pointer)
 Assignment operator.
MemberTypeoperator* ()
 Dereference as object.
MemberTypeoperator-> ()
 Dereference as pointer.
const MemberTypeoperator* () const
 Dereference as const object.
const MemberTypeoperator-> () const
 Dereference as const pointer.
void deallocate ()
 Deallocates the references object if no other pointers reference it.
int count () const

Detailed Description

template<class T>
class Dune::SmartPointer< T >

A reference counting smart pointer.

It is designed such that it is usable within a std::vector. The contained object is destroyed only if there are no more references to it.


Member Typedef Documentation

template<class T>
typedef T Dune::SmartPointer< T >::MemberType

The data type we are a pointer for.

This has to have a parameterless constructor.


The documentation for this class was generated from the following file:
Generated on Mon Apr 26 10:45:24 2010 for dune-common by  doxygen 1.6.3