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

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

Simple referenced counted pointer to non-constant data. More...

#include <CountedPtr.h>

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

List of all members.

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* ()

Detailed Description

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

Simple referenced counted pointer to 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, 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.


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

  • ExcpError


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.

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.

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

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.


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