38 #ifndef BLOCXX_COWREFERENCE_HPP_INCLUDE_GUARD_ 39 #define BLOCXX_COWREFERENCE_HPP_INCLUDE_GUARD_ 40 #include "blocxx/BLOCXX_config.h" 153 #if !defined(__GNUC__) || __GNUC__ > 2 // causes gcc 2.95 to ICE 204 typedef char type_must_be_complete[
sizeof(T)];
205 if (COWReferenceBase::decRef())
216 if (COWReferenceBase::refCountGreaterThanOne())
222 if (COWReferenceBase::getWriteLock())
257 #ifdef BLOCXX_CHECK_NULL_REFERENCES 258 ReferenceHelpers::checkNull(
this);
259 ReferenceHelpers::checkNull(m_pObj);
269 #ifdef BLOCXX_CHECK_NULL_REFERENCES 270 ReferenceHelpers::checkNull(
this);
271 ReferenceHelpers::checkNull(m_pObj);
281 #ifdef BLOCXX_CHECK_NULL_REFERENCES 282 ReferenceHelpers::checkNull(
this);
283 ReferenceHelpers::checkNull(m_pObj);
292 #ifdef BLOCXX_CHECK_NULL_REFERENCES 293 ReferenceHelpers::checkNull(
this);
294 ReferenceHelpers::checkNull(m_pObj);
309 return (m_pObj == 0);
318 rval.
m_pObj = dynamic_cast<U*>(m_pObj);
331 COWReferenceBase::useRefCountOf(arg);
335 template <
class T,
class U>
341 template <
class T,
class U>
347 template <
class T,
class U>
364 #endif // BLOCXX_COWREFERENCE_HPP_
void useRefCountOf(const COWReference< U > &)
const UInt32 INFINITE_TIMEOUT BLOCXX_DEPRECATED
Value that means infinite timeout.
void swap(Array< T > &x, Array< T > &y)
Char16 operator *(const Char16 &arg1, const Char16 &arg2)
void swap(COWReference< T > &arg)
#define BLOCXX_SAFE_BOOL_IMPL(classname, type, variable, test)
~COWReference()
Destroy this COWReference.
COWReference()
Default constructor The underlying object pointer will be NULL.
bool operator!=(const COWReference< T > &a, const COWReference< U > &b)
bool operator==(const COWReference< T > &a, const COWReference< U > &b)
bool isNull() const BLOCXX_DEPRECATED
COWReference A smart pointer that uses non-intrusive reference counting.
COWReference< U > cast_to() const
COWReference< T > & operator=(const COWReference< T > &arg)
Assignment operator.
T * COWReferenceClone(T *obj)
void COWRefSwap(T &x, T &y)
bool operator<(const COWReference< T > &a, const COWReference< U > &b)