diff options
Diffstat (limited to 'xfa/fgas/crt')
-rw-r--r-- | xfa/fgas/crt/fgas_utils.h | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/xfa/fgas/crt/fgas_utils.h b/xfa/fgas/crt/fgas_utils.h index 18bc6fcd6e..105920dc55 100644 --- a/xfa/fgas/crt/fgas_utils.h +++ b/xfa/fgas/crt/fgas_utils.h @@ -170,61 +170,4 @@ class CFX_StackTemplate : public CFX_BaseStack { void RemoveAll(bool bLeaveMemory) { CFX_BaseStack::RemoveAll(bLeaveMemory); } }; -template <class baseType> -class CFX_ObjectStackTemplate : public CFX_BaseStack { - public: - explicit CFX_ObjectStackTemplate(int32_t iChunkSize) - : CFX_BaseStack(iChunkSize, sizeof(baseType)) {} - ~CFX_ObjectStackTemplate() { RemoveAll(false); } - - int32_t Push(const baseType& element) { - int32_t index = CFX_BaseStack::GetSize(); - baseType* p = (baseType*)CFX_BaseStack::Push(); - new ((void*)p) baseType(element); - return index; - } - void Pop() { - baseType* p = (baseType*)CFX_BaseStack::GetTopElement(); - if (p) { - p->~baseType(); - } - CFX_BaseStack::Pop(); - } - baseType* GetTopElement() const { - return (baseType*)CFX_BaseStack::GetTopElement(); - } - int32_t GetSize() const { return CFX_BaseStack::GetSize(); } - baseType* GetAt(int32_t index) const { - return (baseType*)CFX_BaseStack::GetAt(index); - } - void RemoveAll(bool bLeaveMemory) { - int32_t iSize = CFX_BaseStack::GetSize(); - for (int32_t i = 0; i < iSize; i++) { - ((baseType*)CFX_BaseStack::GetAt(i))->~baseType(); - } - CFX_BaseStack::RemoveAll(bLeaveMemory); - } - int32_t Copy(const CFX_ObjectStackTemplate& src, - int32_t iStart, - int32_t iCount) { - if (iCount == 0) { - return CFX_BaseStack::GetSize(); - } - int32_t iSize = src.GetSize(); - ASSERT(iStart > -1 && iStart < iSize); - if (iCount < 0) { - iCount = iSize; - } - int32_t iEnd = iStart + iCount; - if (iEnd > iSize) { - iEnd = iSize; - } - RemoveAll(true); - for (int32_t i = iStart; i < iEnd; i++) { - Push(*src.GetAt(i)); - } - return CFX_BaseStack::GetSize(); - } -}; - #endif // XFA_FGAS_CRT_FGAS_UTILS_H_ |