7 #ifndef MSynch_SmartPtr_h 8 #define MSynch_SmartPtr_h 13 #pragma warning(disable:4284) // return type for 'identifier::operator ->' is not a UDT or reference to a UDT. Will produce errors if applied using infix notation 37 template<
class T,
class DeleteOperator=MBase::DeleteC<T> >
48 template<
class U,
class DeleteOperatorU>
52 reinterpret_cast<Int32*
>(irSmartPtr.mpnRefCount))
70 if (this->
mData != static_cast<T*>(irSmartPtr.mData))
72 this->
ReplaceWith(irSmartPtr.mData,reinterpret_cast<Int32*>(irSmartPtr.mpnRefCount));
86 return *(this->
mData);
89 template<
class U,
class DeleteOperatorU>
93 if(static_cast<U*>(this->
mData) != irSmartPtr.mData)
95 ReplaceWith(reinterpret_cast<T*>(irSmartPtr.mData),irSmartPtr.mpnRefCount);
111 public SmartPtr<T, MBase::DeleteArray<T> >
143 return (this->
mData)[i];
148 #endif // MSynch_SmartPtr_h void ReplaceWith(T * iData, Int32 *ipRefCount)
Definition: SmartBase.h:147
void DownCastFrom(SmartPtr< U, DeleteOperatorU > &irSmartPtr)
Definition: SmartPtr.h:90
T * mData
Definition: SmartBase.h:167
SmartPtr & operator=(T *const ipData)
Definition: SmartPtr.h:58
SmartArrayPtr(T *ipData=NULL)
Definition: SmartPtr.h:114
#define _ASSERTE(x)
Definition: Asserte.h:40
Definition: ReferenceCountedImpl.h:18
T & operator[](int i) const
Definition: SmartPtr.h:140
SmartArrayPtr(SmartArrayPtr< U > &irSmartPtr)
Definition: SmartPtr.h:122
void Reset(T * iData=NULL)
Definition: SmartBase.h:32
SmartPtr(T *const ipData=NULL)
Definition: SmartPtr.h:42
#define Int32
Definition: BasicTypes.h:20
SmartPtr(const SmartPtr< U, DeleteOperatorU > &irSmartPtr)
Definition: SmartPtr.h:49
Definition: Allocator.h:47
Definition: SmartPtr.h:38
SmartArrayPtr & operator=(const SmartArrayPtr< U > &irSmartPtr)
Definition: SmartPtr.h:134
T & operator*() const
Definition: SmartPtr.h:83
SmartArrayPtr & operator=(T *const ipData)
Definition: SmartPtr.h:127
SmartPtr & operator=(const SmartPtr &irSmartPtr)
Definition: SmartPtr.h:67
T * operator->() const
Definition: SmartPtr.h:77
Definition: SmartPtr.h:110
#define NULL
Definition: Null.h:10
Definition: SmartBase.h:20