ReactOS 0.4.16-dev-125-g798ea90
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
 
 if (pNewData==NULL) return NULL
 
virtual CStringDataGetNilString () noexcept
 
virtual IAtlStringMgrClone () noexcept
 
- 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
 
virtual CStringDataGetNilString (void)=0
 
virtual IAtlStringMgrClone (void)=0
 

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
 
virtual _Ret_maybenull_ _In_ int _In_ int nCharSize noexcept
 
CStringDatapNewData
 
ULONG SizeBytes
 
ULONG nDataBytes
 
 nChars
 
 nDataBytes = nChars * nCharSize
 
 pNewData = static_cast<CStringData*>(m_MemMgr->Reallocate(StrData, SizeBytes))
 
pNewData nAllocLength = nChars - 1
 
return pNewData
 
- 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 }
CNilStringData m_NilStrData
Definition: atlstr.h:15
IAtlMemMgr * m_MemMgr
Definition: atlstr.h:14
void SetManager(_In_ IAtlStringMgr *pMgr) noexcept
Definition: atlsimpstr.h:101

◆ ~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)+nChars nCharSize)
virtual

◆ _Post_writable_byte_size_() [2/2]

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

◆ Clone()

virtual IAtlStringMgr * ATL::CAtlStringMgr::Clone ( void  )
inlinevirtualnoexcept

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 {
59 }
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
CStringData * StrData
Definition: atlstr.h:40
virtual void Free(_Inout_opt_ void *Buffer)=0
IAtlStringMgr * pStringMgr
Definition: atlsimpstr.h:50

◆ GetInstance()

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

Definition at line 28 of file atlstr.h.

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

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

◆ GetNilString()

virtual CStringData * ATL::CAtlStringMgr::GetNilString ( void  )
inlinevirtualnoexcept

Implements ATL::IAtlStringMgr.

Definition at line 82 of file atlstr.h.

83 {
85 return &m_NilStrData;
86 }
void AddRef() noexcept
Definition: atlsimpstr.h:60

◆ if() [1/2]

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

◆ if() [2/2]

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

◆ StaticInitialize()

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

Definition at line 93 of file atlstr.h.

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

Member Data Documentation

◆ CharSize

virtual _Ret_maybenull_ _In_ int ATL::CAtlStringMgr::CharSize
Initial value:

Definition at line 37 of file atlstr.h.

◆ m_MemMgr

IAtlMemMgr* ATL::CAtlStringMgr::m_MemMgr
protected

Definition at line 14 of file atlstr.h.

Referenced by Free().

◆ m_NilStrData

CNilStringData ATL::CAtlStringMgr::m_NilStrData
protected

Definition at line 15 of file atlstr.h.

Referenced by CAtlStringMgr(), and GetNilString().

◆ nAllocLength [1/2]

StrData ATL::CAtlStringMgr::nAllocLength = NumChars

Definition at line 49 of file atlstr.h.

◆ nAllocLength [2/2]

pNewData ATL::CAtlStringMgr::nAllocLength = nChars - 1

Definition at line 79 of file atlstr.h.

◆ nChars [1/2]

virtual _Ret_maybenull_ _In_ int ATL::CAtlStringMgr::nChars

Definition at line 63 of file atlstr.h.

◆ nChars [2/2]

ATL::CAtlStringMgr::nChars

Definition at line 72 of file atlstr.h.

◆ nDataBytes [1/2]

ULONG ATL::CAtlStringMgr::nDataBytes

Definition at line 70 of file atlstr.h.

◆ nDataBytes [2/2]

ATL::CAtlStringMgr::nDataBytes = nChars * nCharSize

Definition at line 73 of file atlstr.h.

◆ nDataLength

StrData ATL::CAtlStringMgr::nDataLength = 0

Definition at line 50 of file atlstr.h.

◆ noexcept

virtual _Ret_maybenull_ _In_ int _In_ int nCharSize ATL::CAtlStringMgr::noexcept
Initial value:

Definition at line 64 of file atlstr.h.

◆ nRefs

StrData ATL::CAtlStringMgr::nRefs = 1

Definition at line 48 of file atlstr.h.

◆ pNewData [1/3]

CStringData* ATL::CAtlStringMgr::pNewData

Definition at line 68 of file atlstr.h.

◆ pNewData [2/3]

ATL::CAtlStringMgr::pNewData = static_cast<CStringData*>(m_MemMgr->Reallocate(StrData, SizeBytes))

Definition at line 76 of file atlstr.h.

◆ pNewData [3/3]

return ATL::CAtlStringMgr::pNewData

Definition at line 80 of file atlstr.h.

◆ pStringMgr

StrData ATL::CAtlStringMgr::pStringMgr = this

Definition at line 47 of file atlstr.h.

◆ SizeBytes [1/2]

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

Definition at line 42 of file atlstr.h.

◆ SizeBytes [2/2]

ULONG ATL::CAtlStringMgr::SizeBytes

Definition at line 69 of file atlstr.h.

◆ StrData [1/3]

CStringData* ATL::CAtlStringMgr::StrData

Definition at line 40 of file atlstr.h.

Referenced by Free().

◆ 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: