OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

autoPtr Class Template Reference

Inheritance diagram for autoPtr:

Inheritance graph
[legend]
Collaboration diagram for autoPtr:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class T>
class Foam::autoPtr< T >

Definition at line 59 of file autoPtr.H.


Public Member Functions

 autoPtr (T *=NULL)
 Store object pointer.
 autoPtr (const autoPtr< T > &)
 Construct as copy by transfering pointer to this autoPtr and.
 ~autoPtr ()
 Delete object if pointer is not NULL.
bool valid () const
 Is the autoPtr valid, i.e. is the pointer set.
T * ptr ()
 Return object pointer for reuse.
void set (T *p)
 Set pointer to that given.
void reset (T *p=NULL)
 If object pointer already set delete object and.
void clear ()
 If object pointer points to valid object:.
T & operator() ()
const T & operator() () const
 operator const T & () const
T * operator-> ()
 Return object pointer.
const T * operator-> () const
 Return const object pointer.
void operator= (const autoPtr< T > &)

Constructor & Destructor Documentation

autoPtr ( T *  = NULL  )  [inline, explicit]

Store object pointer.

Definition at line 43 of file autoPtrI.H.

References autoPtr::ptr_.

autoPtr ( const autoPtr< T > &   )  [inline]

Construct as copy by transfering pointer to this autoPtr and.

setting the arguments pointer to NULL

Definition at line 51 of file autoPtrI.H.

~autoPtr (  )  [inline]

Delete object if pointer is not NULL.

Definition at line 61 of file autoPtrI.H.


Member Function Documentation

bool valid (  )  const [inline]

Is the autoPtr valid, i.e. is the pointer set.

Definition at line 71 of file autoPtrI.H.

References autoPtr::ptr(), and Foam::T().

Here is the call graph for this function:

T * ptr (  )  [inline]

Return object pointer for reuse.

Definition at line 78 of file autoPtrI.H.

Referenced by autoPtr::valid().

Here is the caller graph for this function:

void set ( T *  p  )  [inline]

Set pointer to that given.

If object pointer already set issue a FatalError.

Definition at line 89 of file autoPtrI.H.

void reset ( T *  p = NULL  )  [inline]

If object pointer already set delete object and.

set pointer to that given

Definition at line 105 of file autoPtrI.H.

void clear (  )  [inline]

If object pointer points to valid object:.

delete object and set pointer to NULL

Definition at line 119 of file autoPtrI.H.

References FatalErrorIn.

T & operator() (  )  [inline]

Definition at line 128 of file autoPtrI.H.

const T & operator() (  )  const [inline]

Definition at line 142 of file autoPtrI.H.

operator const T & (  )  const [inline]

Definition at line 172 of file autoPtrI.H.

References FatalErrorIn.

T * operator-> (  )  [inline]

Return object pointer.

Definition at line 180 of file autoPtrI.H.

const T * operator-> (  )  const [inline]

Return const object pointer.

Definition at line 195 of file autoPtrI.H.

void operator= ( const autoPtr< T > &   )  [inline]

Definition at line 202 of file autoPtrI.H.


The documentation for this class was generated from the following files: Copyright © 2000-2007 OpenCFD Ltd