Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.atnf.csiro.au/computing/software/casacore/casacore-1.2.0/doc/html/classcasa_1_1PtrRep.html
Дата изменения: Unknown Дата индексирования: Mon Feb 14 20:23:31 2011 Кодировка: Поисковые слова: п п п п п |
Internal representation for CountedPtr
More...
#include <CountedPtr.h>
Protected Member Functions | |
PtrRep (t *v) | |
This constructor sets up the reference count to one and initializes the pointer to the real data. | |
PtrRep (t *v, Bool delit) | |
void | freeVal () |
This deletes the real data if indeed it can be deleted. | |
~PtrRep () | |
This destructor uses the deletable flag to indicate if the real data should be freed or not. | |
Private Attributes | |
t * | val |
unsigned int | count |
Bool | deletable |
Friends | |
class | SimpleCountedPtr< t > |
class | SimpleCountedConstPtr< t > |
class | CountedPtr< t > |
class | CountedConstPtr< t > |
Internal representation for CountedPtr
Internal
This class is a utility class for CountedConstPtr and CountedPtr . It stores the reference count and the pointer to the real data.
Tip: It is currently a template and is used such that t
is the true type of the stored pointer; This means, however, that when it is used, a template instantiation must be done for each type which t
assumes; This makes debugging easier, but in the future all of these pointers could be declared with void
type to avoid template instantiations;
This class isolates all of the low level management of the reference.
Definition at line 78 of file CountedPtr.h.
casa::PtrRep< t >::PtrRep | ( | t * | v | ) | [inline, protected] |
This constructor sets up the reference count to one and initializes the pointer to the real data.
The delit
flag can be passed in to indicate whether the real data should be freed or not when the reference count reaches zero.
Definition at line 96 of file CountedPtr.h.
casa::PtrRep< t >::PtrRep | ( | t * | v, | |
Bool | delit | |||
) | [inline, protected] |
Definition at line 97 of file CountedPtr.h.
casa::PtrRep< t >::~PtrRep | ( | ) | [inline, protected] |
This destructor uses the deletable
flag to indicate if the real data should be freed or not.
Definition at line 106 of file CountedPtr.h.
void casa::PtrRep< t >::freeVal | ( | ) | [protected] |
This deletes the real data if indeed it can be deleted.
Referenced by casa::PtrRep< Block< AutoDiffA< T > > >::~PtrRep().
friend class CountedConstPtr< t > [friend] |
Definition at line 86 of file CountedPtr.h.
friend class CountedPtr< t > [friend] |
Definition at line 85 of file CountedPtr.h.
friend class SimpleCountedConstPtr< t > [friend] |
Definition at line 84 of file CountedPtr.h.
friend class SimpleCountedPtr< t > [friend] |
Definition at line 83 of file CountedPtr.h.
unsigned int casa::PtrRep< t >::count [private] |
Definition at line 113 of file CountedPtr.h.
Bool casa::PtrRep< t >::deletable [private] |
Definition at line 114 of file CountedPtr.h.
t* casa::PtrRep< t >::val [private] |
Definition at line 112 of file CountedPtr.h.