12 #ifndef ROC_CORE_REF_COUNTED_H_
13 #define ROC_CORE_REF_COUNTED_H_
38 template <
class T,
class AllocationPolicy>
40 protected AllocationPolicy {
44 : AllocationPolicy() {
49 : AllocationPolicy(policy) {
66 const int current_counter = impl_.
decref();
68 if (current_counter == 0) {
70 static_cast<T&
>(
const_cast<RefCounted&
>(*
this)));
Base class for non-copyable objects.
Implementation class for reference counter.
int incref() const
Increment reference counter.
int decref() const
Decrement reference counter.
int getref() const
Get reference counter.
Base class for object with reference counter.
int getref() const
Get reference counter.
void incref() const
Increment reference counter.
RefCounted(const AllocationPolicy &policy)
Initialize.
void decref() const
Decrement reference counter.
Implementation class for reference counter.