OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
|
ossimReferenced allows for shared object ref counting if the reference count ever gets to 0 or less it will delete 'this' object. More...
#include <ossimReferenced.h>
Public Member Functions | |
ossimReferenced () | |
ossimReferenced (const ossimReferenced &) | |
ossimReferenced & | operator= (const ossimReferenced &) |
void | ref () const |
increment the reference count by one, indicating that this object has another pointer which is referencing it. More... | |
void | unref () const |
decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
void | unref_nodelete () const |
decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
int | referenceCount () const |
Protected Member Functions | |
virtual | ~ossimReferenced () |
Private Attributes | |
std::atomic_int | m_refCount |
ossimReferenced allows for shared object ref counting if the reference count ever gets to 0 or less it will delete 'this' object.
Currently uses std::mutex to control the locking of the reference count variable.
Eventually we would like to replace all of ossimReferenced and ossimRefPtr with C++11 std::shared_ptr
Definition at line 23 of file ossimReferenced.h.
|
inline |
Definition at line 26 of file ossimReferenced.h.
|
inline |
Definition at line 30 of file ossimReferenced.h.
|
protectedvirtual |
Definition at line 6 of file ossimReferenced.cpp.
References ossimNotify(), ossimNotifyLevel_WARN, and referenceCount().
|
inline |
Definition at line 33 of file ossimReferenced.h.
Referenced by ossim2dTo2dTransform::operator=(), and ossimTieGpt::operator=().
|
inline |
increment the reference count by one, indicating that this object has another pointer which is referencing it.
Definition at line 77 of file ossimReferenced.h.
References m_refCount.
Referenced by ossimImageHandlerMtAdaptor::getTile(), ossimUsgsDemTileSource::getTile(), ossimJpegTileSource::getTile(), ossimGpkgReader::getTile(), ossimHdf5ImageHandler::getTile(), ossimCcfTileSource::getTile(), ossimHdfReader::getTile(), ossimDtedTileSource::getTile(), ossimPngReader::getTile(), ossimH5ImageHandler::getTile(), ossimAdrgTileSource::getTile(), ossimTiffTileSource::getTile(), and ossimGeoPdfReader::getTile().
|
inline |
Definition at line 67 of file ossimReferenced.h.
Referenced by ~ossimReferenced().
|
inline |
decrement the reference count by one, indicating that a pointer to this object is referencing it.
If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.
Definition at line 82 of file ossimReferenced.h.
References m_refCount.
Referenced by ossimGdalOgrVectorAnnotation::deleteTables(), ossimImageHandlerMtAdaptor::getTile(), ossimUsgsDemTileSource::getTile(), ossimJpegTileSource::getTile(), ossimGpkgReader::getTile(), ossimHdf5ImageHandler::getTile(), ossimCcfTileSource::getTile(), ossimHdfReader::getTile(), ossimDtedTileSource::getTile(), ossimH5ImageHandler::getTile(), ossimPngReader::getTile(), ossimAdrgTileSource::getTile(), and ossimGeoPdfReader::getTile().
|
inline |
decrement the reference count by one, indicating that a pointer to this object is referencing it.
However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be resonsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.
Definition at line 58 of file ossimReferenced.h.
|
mutableprivate |
Definition at line 74 of file ossimReferenced.h.