|
TrueReality
v0.1.1912
|
This class is part of the internal garbage collection system. More...
#include <SmrtClass.h>


Public Types | |
| using | BaseClass = osg::Referenced |
Public Member Functions | |
| SmrtClass () | |
| Adds an easy and swappable access to the base class. More... | |
| SmrtClass (bool threadSafeRefUnref) | |
| Constructor. More... | |
| SmrtClass (const SmrtClass &inst) | |
| Copy constructor. More... | |
| virtual bool | GetThreadSafeRefUnref () |
| Get whether a mutex is used to ensure Ref() and UnRef() are thread safe. More... | |
| OpenThreads::Mutex * | GetRefMutex () const |
| Get the mutex used to ensure thread safety of Ref()/UnRef(). More... | |
| int | Ref () const |
| Increment the reference count by one, indicating that this object has another pointer which is referencing it. More... | |
| int | Unref () const |
| Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it. More... | |
| int | UnRefNoDelete () const |
| Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it. More... | |
| int | ReferenceCount () const |
| Return the number of pointers currently referencing this object. More... | |
| virtual const std::string & | GetType () const =0 |
| Returns the class type. More... | |
Static Public Member Functions | |
| static OpenThreads::Mutex * | GetGlobalReferencedMutex () |
| Get the optional global Referenced mutex, this can be shared between all trBase::SmrtClass. More... | |
Protected Member Functions | |
| ~SmrtClass () | |
This class is part of the internal garbage collection system.
Anything that inherits it can also use the smart pointer interface (trBase::SmrtPtr)
It inherits osg::Referenced and uses the OSG garbage collection in its core
Definition at line 38 of file SmrtClass.h.
| using trBase::SmrtClass::BaseClass = osg::Referenced |
Definition at line 42 of file SmrtClass.h.
|
inline |
Adds an easy and swappable access to the base class.
Default constructor.
Definition at line 49 of file SmrtClass.h.
|
inlineexplicit |
Constructor.
| threadSafeRefUnref | True to thread safe reference unref. |
Definition at line 59 of file SmrtClass.h.
|
inline |
|
inlineprotected |
Definition at line 153 of file SmrtClass.h.
|
static |
Get the optional global Referenced mutex, this can be shared between all trBase::SmrtClass.
Definition at line 39 of file SmrtClass.cpp.
| OpenThreads::Mutex * trBase::SmrtClass::GetRefMutex | ( | ) | const |
Get the mutex used to ensure thread safety of Ref()/UnRef().
Definition at line 33 of file SmrtClass.cpp.
|
virtual |
Get whether a mutex is used to ensure Ref() and UnRef() are thread safe.
Definition at line 27 of file SmrtClass.cpp.
|
pure virtual |
Returns the class type.
Implemented in trManager::MessageBase, trCore::Nodes::NodeVisitor, trCore::Nodes::Node, trManager::Invokable, trCore::Nodes::FrameStamp, trSG::Node, trBase::UniqueId, trManager::DirectorBase, trManager::EntityBase, trBase::NodeBase, trManager::SystemManager, trCore::SystemDirector, trManager::ActorModuleBase, trApp::AppBase, trManager::ActorBase, trBase::Base, trBase::UserDataContainer, trSG::NodeVisitor, and trManager::InvokableFunctorCallerBase.
|
inline |
Increment the reference count by one, indicating that this object has another pointer which is referencing it.
Definition at line 45 of file SmrtClass.cpp.
|
inline |
Return the number of pointers currently referencing this object.
Definition at line 63 of file SmrtClass.cpp.
|
inline |
Decrement the reference count by one, indicating that a pointer to this object is no longer 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 51 of file SmrtClass.cpp.
| int trBase::SmrtClass::UnRefNoDelete | ( | ) | const |
Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it.
However, do not delete it, even if ref count goes to 0. Warning, UnRefNoDelete() should only be called if the user knows exactly who will be responsible for it, one should prefer UnRef() over UnRefNoDelete() as the latter can lead to memory leaks.
Definition at line 57 of file SmrtClass.cpp.