# gdcm::SmartPointer< ObjectType > Class Template Reference

Class for Smart Pointer. More...

`#include <gdcmSmartPointer.h>`

Inheritance diagram for gdcm::SmartPointer< ObjectType >:
[legend]
Collaboration diagram for gdcm::SmartPointer< ObjectType >:
[legend]

List of all members.

## Public Member Functions

| SmartPointer ()
| SmartPointer (const SmartPointer< ObjectType > &p)
| SmartPointer (ObjectType const &p)
| SmartPointer (ObjectType *p)
| ~SmartPointer ()
ObjectType * | GetPointer () const
| Explicit function to retrieve the pointer.
| operator ObjectType * () const
| Return pointer to object.
ObjectType & | operator* () const
ObjectType * | operator-> () const
| Overload operator ->
SmartPointer & | operator= (SmartPointer const &r)
| Overload operator assignment.
SmartPointer & | operator= (ObjectType *r)
| Overload operator assignment.
SmartPointer & | operator= (ObjectType const &r)

## Detailed Description

### template<class ObjectType>
class gdcm::SmartPointer< ObjectType >

Class for Smart Pointer.

Will only work for subclass of gdcm::Object See tr1/shared_ptr for a more general approach (not invasive) #include <tr1/memory> { shared_ptr<Bla> b(new Bla); }

Note:
  Class partly based on post by Bill Hubauer: http://groups.google.com/group/comp.lang.c++/msg/173ddc38a827a930

See also:
  http://www.davethehat.com/articles/smartp.htm

and itk::SmartPointer

Examples:

  ChangeSequenceUltrasound.cxx, FixBrokenJ2K.cxx, gdcmrtionplan.cxx, gdcmrtplan.cxx, GenAllVR.cxx, GenFakeIdentifyFile.cxx, GenFakeImage.cxx, GenLongSeqs.cxx, GenSeqs.cxx, GetSubSequenceData.cxx, LargeVRDSExplicit.cxx, ReadAndDumpDICOMDIR.cxx, and ReadExplicitLengthSQIVR.cxx.

## Constructor & Destructor Documentation

template<class ObjectType>

gdcm::SmartPointer< ObjectType >::SmartPointer | ( |  | ) | `[inline]`

template<class ObjectType>

gdcm::SmartPointer< ObjectType >::SmartPointer | ( | const SmartPointer< ObjectType > & | p | ) | `[inline]`

template<class ObjectType>

gdcm::SmartPointer< ObjectType >::SmartPointer | ( | ObjectType * | p | ) | `[inline]`

template<class ObjectType>

gdcm::SmartPointer< ObjectType >::SmartPointer | ( | ObjectType const & | p | ) | `[inline]`

template<class ObjectType>

gdcm::SmartPointer< ObjectType >::~SmartPointer | ( |  | ) | `[inline]`

## Member Function Documentation

template<class ObjectType>

ObjectType* gdcm::SmartPointer< ObjectType >::GetPointer | ( |  | ) | const`[inline]`

Explicit function to retrieve the pointer.

template<class ObjectType>

gdcm::SmartPointer< ObjectType >::operator ObjectType * | ( |  | ) | const`[inline]`

Return pointer to object.

template<class ObjectType>

ObjectType& gdcm::SmartPointer< ObjectType >::operator* | ( |  | ) | const`[inline]`

template<class ObjectType>

ObjectType* gdcm::SmartPointer< ObjectType >::operator-> | ( |  | ) | const`[inline]`

Overload operator ->

template<class ObjectType>

SmartPointer& gdcm::SmartPointer< ObjectType >::operator= | ( | SmartPointer< ObjectType > const & | r | ) | `[inline]`

Overload operator assignment.

Referenced by gdcm::SmartPointer< Value >::operator=().

template<class ObjectType>

SmartPointer& gdcm::SmartPointer< ObjectType >::operator= | ( | ObjectType const & | r | ) | `[inline]`

template<class ObjectType>

SmartPointer& gdcm::SmartPointer< ObjectType >::operator= | ( | ObjectType * | r | ) | `[inline]`

Overload operator assignment.

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

- gdcmSmartPointer.h