24#ifndef __AECSUBPTR_H__
25#define __AECSUBPTR_H__
45 return m_pObject == 0;
73template <
class T,
class B = AECImpObj,
class TBase = AECSubPtrBase<B> >
class AECSubPtr :
public TBase
79 inline void internalAddRef()
81 if( TBase::m_pObject )
85 TBase::m_pObject->addRefSubPtr();
92 inline void internalQueryX(
const OdRxObject* pObj )
96 T* pImp = T::cast( pObj ).
get();
99 TBase::m_pObject = pImp;
109 inline void release()
111 if (TBase::m_pObject)
115 TBase::m_pObject->releaseSubPtr();
116 TBase::m_pObject = 0;
122 inline void assign(
const T* pObj )
125 TBase::m_pObject =
const_cast<T*
>(pObj);
134 internalQueryX( pObj );
139 bool operator !()
const
147 operator bool()
const
166 TBase::m_pObject = 0;
173 TBase::m_pObject =
const_cast<T*
>(pObj);
192 internalQueryX( pObj );
199 TBase::m_pObject =
const_cast<T*
>(pObj.
get());
205 internalQueryX( pObj.get() );
212 internalQueryX( pObj.
get() );
227 TBase::m_pObject =
const_cast<T*
>(pObj.
get());
236 assign( pObj.get() );
244 assign( pObj.
get() );
259 inline const T*
get()
const
261 return static_cast<T*
>(TBase::m_pObject);
268 return static_cast<T*
>(TBase::m_pObject);
275 return static_cast<T*
>(TBase::m_pObject);
282 return static_cast<T*
>(TBase::m_pObject);
291 inline operator T*()
const
293 return static_cast<T*
>(TBase::m_pObject);
301 return static_cast<T*
>(TBase::m_pObject);
307 inline operator const T*()
const
309 return static_cast<T*
>(TBase::m_pObject);
317 return ( TBase::m_pObject == pObj );
333 return ( TBase::m_pObject != pObj );
OdSmartPtr< AECImpObj > AECImpObjPtr
AECSubPtr< AECImpObj > AECImpObjSubPtr
OdSmartPtr< AECSubObj > AECSubObjPtr
AECSubPtr< AECSubObj, AECSubObj > AECSubObjSubPtr
bool operator==(const AECSubPtr &ptr) const
AECSubPtr & operator=(const AECSubPtr &pObj)
bool operator!=(const T *pObj) const
AECSubPtr(const AECSubPtr &pObj)
AECSubPtr(const TBase &pObj)
AECSubPtr(const OdRxObject *pObj)
bool operator!=(const AECSubPtr &ptr) const
AECSubPtr(const OdBaseObjectPtr &pObj)
bool operator==(const T *pObj) const