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 deletes the real data if indeed it can be deleted.
This destructor uses the deletable flag to indicate if the real data should be freed or not.
This class is used as a pointer to constant data. As such, it only has the subset of the CountedConstPtr functions which are relevant for constant data.
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.
After the counted pointer is initialized the value should no longer be manipulated by the raw pointer of type t*.
This constructor sets up a reference count for the val pointer. Since val is a pointer to constant data, the data will not be deleted when the reference count reaches zero.
Since the constant data will NOT be cleaned up when the reference count reaches zero, the use of this class for pointers to constant data may not be desirable.
This copy constructor allows SimpleCountedConstPtrs to be initialized from other SimpleCountedConstPtrs.
This destructor only deletes the really stored data when it was initialized as deletable and the reference count is zero.
The SimpleCountedConstPtr 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.
The address of the reference returned should not be stored for later use.
Equality operator which checks to see if two SimpleCountedConstPtrs are pointing at the same thing.
Non-equality operator which checks to see if two SimpleCountedConstPtrs are not pointing at the same thing.
This assignment operator allows SimpleCountedConstPtrs to be freely assigned to each other.
This assignment operator allows the object to which the current SimpleCountedConstPtr points to be changed.
Sometimes it is useful to know if there is more than one reference made. This is a way of getting that. Of course the point of these classes is that this information is normally not required.
This function changes the value for this SimpleCountedConstPtr and all of the other SimpleCountedConstPtrs which point to this same value.
This is dangerous, and generally should not be done.
Check to see if this SimpleCountedConstPtr is un-initialized, null.
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.
After the counted pointer is initialized the value should no longer be manipulated by the raw pointer of type t*.
This copy constructor allows CountedConstPtrs to be initialized from other CountedConstPtrs.
This assignment operator allows CountedConstPtrs to be freely assigned to each other.
This assignment operator allows the object to which the current CountedConstPtr points to be changed.
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.
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.
After the counted pointer is initialized the value should no longer be manipulated by the raw pointer of type t*.
This copy constructor allows SimpleCountedPtrs to be initialized from other SimpleCountedPtrs.
This assignment operator allows SimpleCountedPtrs to be freely assigned to each other.
This assignment operator allows the object to which the current SimpleCountedPtr points to be changed.
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.
The address of the reference returned should not be stored for later use.
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.
After the counted pointer is initialized the value should no longer be manipulated by the raw pointer of type t*.
This copy constructor allows CountedPtrs to be initialized from other CountedPtrs.
This assignment operator allows CountedPtrs to be freely assigned to each other.
This assignment operator allows the object to which the current CountedPtr points to be changed.
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.