ememory::Counter Class Reference
#include <Counter.hpp>
Public Types | |
enum | remove { remove::none, remove::data, remove::counter, remove::all } |
Public Member Functions | |
Counter (bool _fromWeak=false) | |
~Counter () | |
int64_t | incrementShared (bool _fromWeak=false) |
ememory::Counter::remove | decrementShared () |
int64_t | incrementWeak () |
ememory::Counter::remove | decrementWeak () |
int64_t | getCountWeak () const |
int64_t | getCountShared () const |
int64_t | getCount () const |
Detailed Description
Couter is an important part of the SharedPtr/WeakPtr implementation. This use a simple refcounting method dut thread-safe.
Member Enumeration Documentation
§ remove
|
strong |
Constructor & Destructor Documentation
§ Counter()
ememory::Counter::Counter | ( | bool | _fromWeak = false | ) |
§ ~Counter()
ememory::Counter::~Counter | ( | ) |
Destrunctor (Not virtual !!)
Member Function Documentation
§ decrementShared()
ememory::Counter::remove ememory::Counter::decrementShared | ( | ) |
Decrese of 1 the shared counter.
- Returns
- The action to do on the pointer or the counter
§ decrementWeak()
ememory::Counter::remove ememory::Counter::decrementWeak | ( | ) |
Decrese of 1 the weak counter.
- Returns
- The action to do on the pointer or the counter
§ getCount()
int64_t ememory::Counter::getCount | ( | ) | const |
§ getCountShared()
int64_t ememory::Counter::getCountShared | ( | ) | const |
Get the number of shared counter.
- Returns
- Number of SharedPtr connected.
§ getCountWeak()
int64_t ememory::Counter::getCountWeak | ( | ) | const |
Get the number of weak counter.
- Returns
- Number of WeakPtr connected.
§ incrementShared()
int64_t ememory::Counter::incrementShared | ( | bool | _fromWeak = false | ) |
§ incrementWeak()
int64_t ememory::Counter::incrementWeak | ( | ) |
Increment the weak counter (one more weak user)
- Returns
- Number of current WeakPtr that has been curently access at this data.
The documentation for this class was generated from the following file:
- framework/atria-soft/ememory/ememory/Counter.hpp