15 #ifndef RAPIDJSON_INTERNAL_STACK_H_ 16 #define RAPIDJSON_INTERNAL_STACK_H_ 18 #include "../rapidjson.h" 30 template <
typename Allocator>
39 #if RAPIDJSON_HAS_CXX11_RVALUE_REFS 49 rhs.ownAllocator_ = 0;
53 rhs.initialCapacity_ = 0;
61 #if RAPIDJSON_HAS_CXX11_RVALUE_REFS 75 rhs.ownAllocator_ = 0;
79 rhs.initialCapacity_ = 0;
116 T* ret =
reinterpret_cast<T*
>(
stackTop_);
131 return reinterpret_cast<T*
>(
stackTop_ -
sizeof(T));
160 newCapacity += (newCapacity + 1) / 2;
162 size_t newSize =
GetSize() +
sizeof(T) * count;
163 if (newCapacity < newSize)
164 newCapacity = newSize;
196 #endif // RAPIDJSON_STACK_H_
void Expand(size_t count)
RAPIDJSON_FORCEINLINE T * Push(size_t count=1)
#define RAPIDJSON_NAMESPACE_BEGIN
provide custom rapidjson namespace (opening expression)
Allocator & GetAllocator()
bool HasAllocator() const
size_t GetCapacity() const
GLuint GLuint GLsizei count
void Resize(size_t newCapacity)
#define RAPIDJSON_NEW(x)
! customization point for global new
#define RAPIDJSON_NAMESPACE_END
provide custom rapidjson namespace (closing expression)
void Swap(T &a, T &b) RAPIDJSON_NOEXCEPT
Custom swap() to avoid dependency on C++ <algorith> header.
#define RAPIDJSON_DELETE(x)
! customization point for global delete
A type-unsafe stack for storing different types of data.
Allocator * ownAllocator_
Stack & operator=(const Stack &)
Stack(Allocator *allocator, size_t stackCapacity)
#define RAPIDJSON_ASSERT(x)
Assertion.
void Swap(Stack &rhs) RAPIDJSON_NOEXCEPT