38 #ifndef BLOCXX_CBLOCXX_REFERENCE_BASE_HPP_INCLUDE_GUARD_
39 #define BLOCXX_CBLOCXX_REFERENCE_BASE_HPP_INCLUDE_GUARD_
40 #include "blocxx/BLOCXX_config.h"
61 class BLOCXX_COMMON_API COWReferenceBase
65 : m_pRefCount(new RefCount) {}
66 COWReferenceBase(
const COWReferenceBase& arg)
67 : m_pRefCount(arg.m_pRefCount)
78 if (m_pRefCount->decAndTest())
86 bool refCountGreaterThanOne()
const
88 return m_pRefCount->get() > 1;
94 if (m_pRefCount->decAndTest())
113 void useRefCountOf(
const COWReferenceBase& arg)
116 m_pRefCount = arg.m_pRefCount;