|
Lunchbox
1.17.0
Multi-threaded C++ toolbox library for all application developers creating high-performance multi-threaded programs.
|
Base class for referenced objects. More...
#include <referenced.h>
Inheritance diagram for lunchbox::Referenced:
Collaboration diagram for lunchbox::Referenced:Public Member Functions | |
| void | ref (const void *holder=0) const |
| Increase the reference count. More... | |
| bool | unref (const void *holder=0) const |
| Decrease the reference count. More... | |
| int32_t | getRefCount () const |
| void | printHolders (std::ostream &) const |
Protected Member Functions | |
| Referenced () | |
| Construct a new reference-counted object. More... | |
| Referenced (const Referenced &) | |
| Construct a new copy of a reference-counted object. More... | |
| virtual | ~Referenced () |
| Destruct a reference-counted object. More... | |
| Referenced & | operator= (const Referenced &) |
| Assign another object to this object. More... | |
| virtual void | notifyFree () |
Base class for referenced objects.
Implements reference-counted objects which destroy themselves once they are no longer referenced. Uses an Atomic variable to keep the reference count access thread-safe and efficient.
Definition at line 45 of file referenced.h.
|
protected |
Construct a new reference-counted object.
Referenced by getRefCount().
Here is the caller graph for this function:
|
inlineprotected |
Construct a new copy of a reference-counted object.
Definition at line 128 of file referenced.h.
References ~Referenced().
Here is the call graph for this function:
|
protectedvirtual |
Destruct a reference-counted object.
Referenced by Referenced().
Here is the caller graph for this function:
|
inline |
Definition at line 103 of file referenced.h.
References lunchbox::disableFlush(), lunchbox::disableHeader(), lunchbox::enableFlush(), lunchbox::enableHeader(), and Referenced().
Here is the call graph for this function:
|
inlineprotected |
Assign another object to this object.
Definition at line 142 of file referenced.h.
References ref(), and unref().
Here is the call graph for this function:
|
inline |
Increase the reference count.
Definition at line 49 of file referenced.h.
References lunchbox::backtrace(), lunchbox::Clock::getTime64(), and lunchbox::Log::instance().
Referenced by operator=().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Decrease the reference count.
The object is deleted when the reference count reaches 0.
Definition at line 78 of file referenced.h.
Referenced by operator=().
Here is the caller graph for this function: