ReactOS  0.4.12-dev-14-gd0c8636
ATL::CAtlStringMgr Class Reference

#include <atlstr.h>

Inheritance diagram for ATL::CAtlStringMgr:
Collaboration diagram for ATL::CAtlStringMgr:

Public Member Functions

 CAtlStringMgr (_In_opt_ IAtlMemMgr *MemMgr=NULL)
 
virtual ~CAtlStringMgr (void)
 
virtual _Ret_maybenull_ _Post_writable_byte_size_ (sizeof(CStringData)+NumChars *CharSize) CStringData *Allocate(_In_ int NumChars
 
 if (StrData==NULL) return NULL
 
virtual void Free (_In_ CStringData *StrData)
 
virtual _Ret_maybenull_ _Post_writable_byte_size_ (sizeof(CStringData)+nChars *nCharSize) CStringData *Reallocate(_Inout_ _Post_readable_byte_size_(sizeof(CStringData)) CStringData *StrData
 
virtual _Ret_maybenull_ _In_ int _In_ int nCharSize throw ()
 
virtual CStringDataGetNilString () throw ()
 
virtual IAtlStringMgrClone () throw ()
 
- Public Member Functions inherited from ATL::IAtlStringMgr
virtual ~IAtlStringMgr ()
 
virtual _Ret_maybenull_ _Post_writable_byte_size_ (sizeof(CStringData)+nAllocLength *nCharSize) CStringData *Allocate(_In_ int nAllocLength
 
virtual void Free (_Inout_ CStringData *pData)=0
 
virtual _Ret_maybenull_ _Post_writable_byte_size_ (sizeof(CStringData)+nAllocLength *nCharSize) CStringData *Reallocate(_Inout_ CStringData *pData
 

Static Public Member Functions

static IAtlStringMgrGetInstance (void)
 

Public Attributes

virtual _Ret_maybenull_ _In_ int CharSize
 
CStringDataStrData
 
 SizeBytes = sizeof(CStringData) + ((NumChars + 1) * CharSize)
 
 StrData = static_cast<CStringData*>(m_MemMgr->Allocate(SizeBytes))
 
StrData pStringMgr = this
 
StrData nRefs = 1
 
StrData nAllocLength = NumChars
 
StrData nDataLength = 0
 
return StrData
 
virtual _Ret_maybenull_ _In_ int nChars
 
- Public Attributes inherited from ATL::IAtlStringMgr
virtual _Ret_maybenull_ _In_ int nCharSize = 0
 
virtual _Ret_maybenull_ _In_ int nAllocLength
 
virtual _Ret_maybenull_ _In_ int _In_ int nCharSize = 0
 

Protected Attributes

IAtlMemMgrm_MemMgr
 
CNilStringData m_NilStrData
 

Static Private Member Functions

static bool StaticInitialize ()
 

Detailed Description

Definition at line 11 of file atlstr.h.

Constructor & Destructor Documentation

◆ CAtlStringMgr()

ATL::CAtlStringMgr::CAtlStringMgr ( _In_opt_ IAtlMemMgr MemMgr = NULL)
inline

Definition at line 18 of file atlstr.h.

18  :
19  m_MemMgr(MemMgr)
20  {
22  }
IAtlMemMgr * m_MemMgr
Definition: atlstr.h:14
void SetManager(_In_ IAtlStringMgr *pMgr)
Definition: atlsimpstr.h:95
CNilStringData m_NilStrData
Definition: atlstr.h:15

◆ ~CAtlStringMgr()

virtual ATL::CAtlStringMgr::~CAtlStringMgr ( void  )
inlinevirtual

Definition at line 24 of file atlstr.h.

25  {
26  }

Member Function Documentation

◆ _Post_writable_byte_size_() [1/2]

virtual _Ret_maybenull_ ATL::CAtlStringMgr::_Post_writable_byte_size_ ( sizeof(CStringData)+NumChars *  CharSize)
virtual

Referenced by Free(), and GetInstance().

◆ _Post_writable_byte_size_() [2/2]

virtual _Ret_maybenull_ ATL::CAtlStringMgr::_Post_writable_byte_size_ ( sizeof(CStringData)+nChars nCharSize)
virtual

◆ Clone()

virtual IAtlStringMgr* ATL::CAtlStringMgr::Clone ( void  )
throw (
)
inlinevirtual

Implements ATL::IAtlStringMgr.

Definition at line 87 of file atlstr.h.

88  {
89  return this;
90  }

◆ Free()

virtual void ATL::CAtlStringMgr::Free ( _In_ CStringData StrData)
inlinevirtual

Definition at line 55 of file atlstr.h.

56  {
57  ATLASSERT(StrData->pStringMgr == this);
59  }
#define ATLASSERT(x)
Definition: CComVariant.cpp:9
IAtlMemMgr * m_MemMgr
Definition: atlstr.h:14
virtual void Free(_Inout_opt_ void *Buffer)=0
IAtlStringMgr * pStringMgr
Definition: atlsimpstr.h:44
CStringData * StrData
Definition: atlstr.h:40

◆ GetInstance()

static IAtlStringMgr* ATL::CAtlStringMgr::GetInstance ( void  )
inlinestatic

Definition at line 28 of file atlstr.h.

Referenced by ATL::StrTraitATL< _BaseType, StringIterator >::GetDefaultManager(), and StaticInitialize().

29  {
30  static CWin32Heap Win32Heap(::GetProcessHeap());
31  static CAtlStringMgr StringMgr(&Win32Heap);
32  return &StringMgr;
33  }
#define GetProcessHeap()
Definition: compat.h:395

◆ GetNilString()

virtual CStringData* ATL::CAtlStringMgr::GetNilString ( void  )
throw (
)
inlinevirtual

Implements ATL::IAtlStringMgr.

Definition at line 82 of file atlstr.h.

83  {
85  return &m_NilStrData;
86  }
CNilStringData m_NilStrData
Definition: atlstr.h:15

◆ if()

ATL::CAtlStringMgr::if ( StrData  = =NULL)

◆ StaticInitialize()

static bool ATL::CAtlStringMgr::StaticInitialize ( )
inlinestaticprivate

Definition at line 93 of file atlstr.h.

94  {
95  GetInstance();
96  return true;
97  }
static IAtlStringMgr * GetInstance(void)
Definition: atlstr.h:28

◆ throw()

virtual _Ret_maybenull_ _In_ int _In_ int nCharSize ATL::CAtlStringMgr::throw ( )
inline

Definition at line 64 of file atlstr.h.

65  {
66  ATLASSERT(StrData->pStringMgr == this);
67 
68  CStringData* pNewData;
70  ULONG nDataBytes;
71 
72  nChars++;
73  nDataBytes = nChars * nCharSize;
74  SizeBytes = sizeof(CStringData) + nDataBytes;
75 
76  pNewData = static_cast<CStringData*>(m_MemMgr->Reallocate(StrData, SizeBytes));
77  if (pNewData == NULL) return NULL;
78 
79  pNewData->nAllocLength = nChars - 1;
80  return pNewData;
81  }
#define ATLASSERT(x)
Definition: CComVariant.cpp:9
IAtlMemMgr * m_MemMgr
Definition: atlstr.h:14
smooth NULL
Definition: ftsmooth.c:416
virtual _Ret_maybenull_ _In_ int nCharSize
Definition: atlsimpstr.h:24
virtual _Ret_maybenull_ _In_ int nChars
Definition: atlstr.h:63
IAtlStringMgr * pStringMgr
Definition: atlsimpstr.h:44
unsigned int ULONG
Definition: retypes.h:1
CStringData * StrData
Definition: atlstr.h:40

Member Data Documentation

◆ CharSize

virtual _Ret_maybenull_ _In_ int ATL::CAtlStringMgr::CharSize
Initial value:
{
size_t SizeBytes

Definition at line 38 of file atlstr.h.

Referenced by GetInstance().

◆ m_MemMgr

IAtlMemMgr* ATL::CAtlStringMgr::m_MemMgr
protected

Definition at line 14 of file atlstr.h.

◆ m_NilStrData

CNilStringData ATL::CAtlStringMgr::m_NilStrData
protected

Definition at line 15 of file atlstr.h.

Referenced by GetNilString().

◆ nAllocLength

StrData ATL::CAtlStringMgr::nAllocLength = NumChars

Definition at line 49 of file atlstr.h.

◆ nChars

virtual _Ret_maybenull_ _In_ int ATL::CAtlStringMgr::nChars

Definition at line 63 of file atlstr.h.

Referenced by Free(), and throw().

◆ nDataLength

StrData ATL::CAtlStringMgr::nDataLength = 0

Definition at line 50 of file atlstr.h.

◆ nRefs

StrData ATL::CAtlStringMgr::nRefs = 1

Definition at line 48 of file atlstr.h.

◆ pStringMgr

StrData ATL::CAtlStringMgr::pStringMgr = this

Definition at line 47 of file atlstr.h.

◆ SizeBytes

ATL::CAtlStringMgr::SizeBytes = sizeof(CStringData) + ((NumChars + 1) * CharSize)

Definition at line 42 of file atlstr.h.

Referenced by throw().

◆ StrData [1/3]

CStringData* ATL::CAtlStringMgr::StrData

Definition at line 40 of file atlstr.h.

◆ StrData [2/3]

ATL::CAtlStringMgr::StrData = static_cast<CStringData*>(m_MemMgr->Allocate(SizeBytes))

Definition at line 44 of file atlstr.h.

◆ StrData [3/3]

return ATL::CAtlStringMgr::StrData

Definition at line 52 of file atlstr.h.


The documentation for this class was generated from the following file: