mirror of
https://github.com/reactos/reactos.git
synced 2025-07-27 15:11:41 +00:00
[ATL] Rename CHeapPtr data member, since it is public
This commit is contained in:
parent
55032c3122
commit
45d33582e7
1 changed files with 22 additions and 22 deletions
|
@ -98,18 +98,18 @@ class CHeapPtr
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CHeapPtr() :
|
CHeapPtr() :
|
||||||
m_Data(NULL)
|
m_pData(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
explicit CHeapPtr(T *lp) :
|
explicit CHeapPtr(T *lp) :
|
||||||
m_Data(lp)
|
m_pData(lp)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
explicit CHeapPtr(CHeapPtr<T, Allocator> &lp)
|
explicit CHeapPtr(CHeapPtr<T, Allocator> &lp)
|
||||||
{
|
{
|
||||||
m_Data = lp.Detach();
|
m_pData = lp.Detach();
|
||||||
}
|
}
|
||||||
|
|
||||||
~CHeapPtr()
|
~CHeapPtr()
|
||||||
|
@ -119,24 +119,24 @@ public:
|
||||||
|
|
||||||
CHeapPtr<T, Allocator>& operator = (CHeapPtr<T, Allocator> &lp)
|
CHeapPtr<T, Allocator>& operator = (CHeapPtr<T, Allocator> &lp)
|
||||||
{
|
{
|
||||||
if (lp.m_Data != m_Data)
|
if (lp.m_pData != m_pData)
|
||||||
Attach(lp.Detach());
|
Attach(lp.Detach());
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AllocateBytes(_In_ size_t nBytes)
|
bool AllocateBytes(_In_ size_t nBytes)
|
||||||
{
|
{
|
||||||
ATLASSERT(m_Data == NULL);
|
ATLASSERT(m_pData == NULL);
|
||||||
m_Data = static_cast<T*>(Allocator::Allocate(nBytes));
|
m_pData = static_cast<T*>(Allocator::Allocate(nBytes));
|
||||||
return m_Data != NULL;
|
return m_pData != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ReallocateBytes(_In_ size_t nBytes)
|
bool ReallocateBytes(_In_ size_t nBytes)
|
||||||
{
|
{
|
||||||
T* newData = static_cast<T*>(Allocator::Reallocate(m_Data, nBytes));
|
T* newData = static_cast<T*>(Allocator::Reallocate(m_pData, nBytes));
|
||||||
if (newData == NULL)
|
if (newData == NULL)
|
||||||
return false;
|
return false;
|
||||||
m_Data = newData;
|
m_pData = newData;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,43 +152,43 @@ public:
|
||||||
|
|
||||||
void Free()
|
void Free()
|
||||||
{
|
{
|
||||||
if (m_Data)
|
if (m_pData)
|
||||||
{
|
{
|
||||||
Allocator::Free(m_Data);
|
Allocator::Free(m_pData);
|
||||||
m_Data = NULL;
|
m_pData = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Attach(T *lp)
|
void Attach(T *lp)
|
||||||
{
|
{
|
||||||
Allocator::Free(m_Data);
|
Allocator::Free(m_pData);
|
||||||
m_Data = lp;
|
m_pData = lp;
|
||||||
}
|
}
|
||||||
|
|
||||||
T *Detach()
|
T *Detach()
|
||||||
{
|
{
|
||||||
T *saveP = m_Data;
|
T *saveP = m_pData;
|
||||||
m_Data = NULL;
|
m_pData = NULL;
|
||||||
return saveP;
|
return saveP;
|
||||||
}
|
}
|
||||||
|
|
||||||
T **operator &()
|
T **operator &()
|
||||||
{
|
{
|
||||||
ATLASSERT(m_Data == NULL);
|
ATLASSERT(m_pData == NULL);
|
||||||
return &m_Data;
|
return &m_pData;
|
||||||
}
|
}
|
||||||
|
|
||||||
operator T* () const
|
operator T* () const
|
||||||
{
|
{
|
||||||
return m_Data;
|
return m_pData;
|
||||||
}
|
}
|
||||||
|
|
||||||
T* operator->() const
|
T* operator->() const
|
||||||
{
|
{
|
||||||
return m_Data;
|
return m_pData;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
public:
|
||||||
T *m_Data;
|
T *m_pData;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue