A thread-safe reference to a shared object.
Object refs are used with the messaging system to reference opaque objects created and manipulated in other threads. ObjectRef objects must be created on the heap (thus they are ref-counted) because the "client-side" owner-object may be discarded before the target object in the other thread is destroyed.
- Copyright
- (C) 2010 Radon Labs GmbH
-
(C) 2013-2020 Individual contributors, see AUTHORS file
|
| ObjectRef () |
| constructor
|
|
virtual | ~ObjectRef () |
| destructor
|
|
bool | IsValid () const |
| return true if the ObjectRef points to a valid object
|
|
template<class TYPE > |
void | Validate (TYPE *obj) |
| validate the ref with a pointer to a target object (must be RefCounted)
|
|
void | Invalidate () |
| invalidate the ref
|
|
template<class TYPE > |
TYPE * | Ref () const |
| get pointer to object
|
|
| RefCounted () |
| constructor
|
|
int | GetRefCount () const |
| get the current refcount
|
|
void | AddRef () |
| increment refcount by one
|
|
void | Release () |
| decrement refcount and destroy object if refcount is zero
|
|
bool | IsInstanceOf (const Rtti &rtti) const |
| return true if this object is instance of given class
|
|
bool | IsInstanceOf (const Util::String &className) const |
| return true if this object is instance of given class by string
|
|
bool | IsInstanceOf (const Util::FourCC &classFourCC) const |
| return true if this object is instance of given class by fourcc
|
|
bool | IsA (const Rtti &rtti) const |
| return true if this object is instance of given class, or a derived class
|
|
bool | IsA (const Util::String &rttiName) const |
| return true if this object is instance of given class, or a derived class, by string
|
|
bool | IsA (const Util::FourCC &rttiFourCC) const |
| return true if this object is instance of given class, or a derived class, by fourcc
|
|
const Util::String & | GetClassName () const |
| get the class name
|
|
Util::FourCC | GetClassFourCC () const |
| get the class FourCC code
|
|