casa::SimpleCountedPtr< t > Class Template Reference
[Utilities]

#include <CountedPtr.h>

Inheritance diagram for casa::SimpleCountedPtr< t >:

Inheritance graph
[legend]
Collaboration diagram for casa::SimpleCountedPtr< t >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class t>
class casa::SimpleCountedPtr< t >

Simple referenced counted pointer to non-constant data.

Intended use:

Part of API

Review Status

Reviewed By:
Friso Olnon
Date Reviewed:
1995/03/15
Test programs:
tCountedPtr

Prerequisite

Synopsis

This class, like SimpleCountedConstPtr , does not define the operator->(). Thus it can point to simple data which does not have this operator defined. In contrast to SimpleCountedConstPtr, this class points at non-constant underlying data. The deletion properties are the same for both classes.

Definition at line 387 of file CountedPtr.h.

Public Member Functions

 SimpleCountedPtr ()
 This constructor allows for the creation of a null SimpleCountedPtr.
 SimpleCountedPtr (t *val, Bool delit=True)
 This constructor sets up a reference count for the val pointer.
 SimpleCountedPtr (const SimpleCountedPtr< t > &val)
 This copy constructor allows SimpleCountedPtrs to be initialized from other SimpleCountedPtrs.
SimpleCountedPtr< t > & operator= (const SimpleCountedPtr< t > &val)
 This assignment operator allows SimpleCountedPtrs to be freely assigned to each other.
SimpleCountedPtr< t > & operator= (t *v)
 This assignment operator allows the object to which the current SimpleCountedPtr points to be changed.
const t & operator * () const
 The SimpleCountedPtr indirection operator simply returns a reference to the value being protected.
t & operator * ()


Constructor & Destructor Documentation

template<class t>
casa::SimpleCountedPtr< t >::SimpleCountedPtr (  )  [inline]

This constructor allows for the creation of a null SimpleCountedPtr.

The assignment operator can be used to assign a null SimpleCountedPtr from another pointer.

Definition at line 394 of file CountedPtr.h.

template<class t>
casa::SimpleCountedPtr< t >::SimpleCountedPtr ( t *  val,
Bool  delit = True 
) [inline]

This constructor sets up a reference count for the val pointer.

By default, the data pointed to by val will be deleted when it is no longer referenced. Passing in False for delit will prevent the data from being deleted when the reference count reaches zero.

Warning: After the counted pointer is initialized the value should no longer be manipulated by the raw pointer of type t*.

Definition at line 407 of file CountedPtr.h.

template<class t>
casa::SimpleCountedPtr< t >::SimpleCountedPtr ( const SimpleCountedPtr< t > &  val  )  [inline]

This copy constructor allows SimpleCountedPtrs to be initialized from other SimpleCountedPtrs.

Definition at line 412 of file CountedPtr.h.


Member Function Documentation

template<class t>
SimpleCountedPtr<t>& casa::SimpleCountedPtr< t >::operator= ( const SimpleCountedPtr< t > &  val  )  [inline]

This assignment operator allows SimpleCountedPtrs to be freely assigned to each other.

Definition at line 417 of file CountedPtr.h.

template<class t>
SimpleCountedPtr<t>& casa::SimpleCountedPtr< t >::operator= ( t *  v  )  [inline]

This assignment operator allows the object to which the current SimpleCountedPtr points to be changed.

Reimplemented from casa::SimpleCountedConstPtr< t >.

Definition at line 425 of file CountedPtr.h.

template<class t>
const t& casa::SimpleCountedPtr< t >::operator * (  )  const [inline]

The SimpleCountedPtr indirection operator simply returns a reference to the value being protected.

If the pointer is un-initialized (null), an exception will be thrown. The member function null () can be used to catch such a condition in time.

Thrown Exceptions

Tip: The address of the reference returned should not be stored for later use.

Reimplemented from casa::SimpleCountedConstPtr< t >.

Definition at line 446 of file CountedPtr.h.

template<class t>
t& casa::SimpleCountedPtr< t >::operator * (  )  [inline]

Definition at line 450 of file CountedPtr.h.


The documentation for this class was generated from the following file:
Generated on Mon Sep 1 22:44:26 2008 for NRAOCASA by  doxygen 1.5.1