Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.atnf.csiro.au/computing/software/casacore/casacore-1.2.0/doc/html/classcasa_1_1CountedPtr.html
Дата изменения: Unknown
Дата индексирования: Mon Feb 14 21:33:54 2011
Кодировка:
casacore: casa::CountedPtr< t > Class Template Reference
Public Member Functions

casa::CountedPtr< t > Class Template Reference
[Utilities_module]

Regular referenced counted pointer for non-constant data. More...

#include <CountedPtr.h>

Inheritance diagram for casa::CountedPtr< t >:
casa::SimpleCountedPtr< t > casa::CountedConstPtr< t > casa::SimpleCountedConstPtr< t > casa::SimpleCountedConstPtr< t >

List of all members.

Public Member Functions

 CountedPtr ()
 This constructor allows for the creation of a null CountedPtr.
 CountedPtr (t *val, Bool delit=True)
 This constructor sets up a reference count for the val pointer.
 CountedPtr (const CountedPtr< t > &val)
 This copy constructor allows CountedPtrs to be initialized from other CountedPtrs.
CountedPtr< t > & operator= (const CountedPtr< t > &val)
 This assignment operator allows CountedPtrs to be freely assigned to each other.
CountedPtr< t > & operator= (t *v)
 This assignment operator allows the object to which the current CountedPtr points to be changed.
t * operator-> () const
 This dereferencing operator behaves as expected; it returns the pointer to the value being protected, and then its dereferencing operator will be invoked as appropriate.
t * operator-> ()

Detailed Description

template<class t>
class casa::CountedPtr< t >

Regular referenced counted pointer for non-constant data.

Intended use:

Public interface

Review Status

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

Prerequisite

Synopsis

This class completes the lattice. It inherits much of the members which deal with non-constant data from SimpleCountedPtr , and it inherits the const operator->() from CountedConstPtr . What this class adds is the operator->() which returns a modifiable pointer.

Definition at line 477 of file CountedPtr.h.


Constructor & Destructor Documentation

template<class t>
casa::CountedPtr< t >::CountedPtr (  ) 

This constructor allows for the creation of a null CountedPtr.

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

template<class t>
casa::CountedPtr< t >::CountedPtr ( t *  val,
Bool  delit = True 
)

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*;

template<class t>
casa::CountedPtr< t >::CountedPtr ( const CountedPtr< t > &  val  ) 

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


Member Function Documentation

template<class t>
t* casa::CountedPtr< t >::operator-> (  )  const [inline]

This dereferencing operator behaves as expected; it returns the pointer to the value being protected, and then its dereferencing operator will be invoked as appropriate.

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

  • ExcpError

Reimplemented from casa::CountedConstPtr< t >.

Definition at line 536 of file CountedPtr.h.

template<class t>
t* casa::CountedPtr< t >::operator-> (  )  [inline]

Definition at line 540 of file CountedPtr.h.

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

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

Definition at line 510 of file CountedPtr.h.

Referenced by casa::CountedPtr< Block< AutoDiffA< T > > >::operator=().

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

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

Reimplemented from casa::CountedConstPtr< t >.

Definition at line 518 of file CountedPtr.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines