15 #ifndef RAPIDJSON_INTERNAL_STACK_H_ 16 #define RAPIDJSON_INTERNAL_STACK_H_ 18 #include "../allocators.h" 21 #if defined(__clang__) 23 RAPIDJSON_DIAG_OFF(
c++98-compat)
35 template <
typename Allocator>
43 #if RAPIDJSON_HAS_CXX11_RVALUE_REFS 53 rhs.ownAllocator_ = 0;
57 rhs.initialCapacity_ = 0;
65 #if RAPIDJSON_HAS_CXX11_RVALUE_REFS 79 rhs.ownAllocator_ = 0;
83 rhs.initialCapacity_ = 0;
124 return PushUnsafe<T>(
count);
146 return reinterpret_cast<T*
>(
stackTop_ -
sizeof(
T));
152 return reinterpret_cast<T*
>(
stackTop_ -
sizeof(
T));
191 newCapacity += (newCapacity + 1) / 2;
194 if (newCapacity < newSize)
195 newCapacity = newSize;
227 #if defined(__clang__) 231 #endif // RAPIDJSON_STACK_H_ char * stack_
Definition: stack.h:218
~Stack()
Definition: stack.h:61
const uint32_t T[512]
Definition: groestl_tables.h:36
const T * Bottom() const
Definition: stack.h:165
Allocator * ownAllocator_
Definition: stack.h:217
int * count
Definition: gmock_stress_test.cc:176
#define RAPIDJSON_ASSERT(x)
Assertion.
Definition: rapidjson.h:411
RAPIDJSON_FORCEINLINE T * PushUnsafe(size_t count=1)
Definition: stack.h:128
void Expand(size_t count)
Definition: stack.h:182
#define RAPIDJSON_NAMESPACE_END
provide custom rapidjson namespace (closing expression)
Definition: rapidjson.h:124
void Resize(size_t newCapacity)
Definition: stack.h:200
A type-unsafe stack for storing different types of data.
Definition: stack.h:36
const T * End() const
Definition: stack.h:159
void Clear()
Definition: stack.h:98
#define RAPIDJSON_NAMESPACE_BEGIN
provide custom rapidjson namespace (opening expression)
Definition: rapidjson.h:121
Stack & operator=(const Stack &)
RAPIDJSON_FORCEINLINE T * Push(size_t count=1)
Definition: stack.h:122
void Destroy()
Definition: stack.h:207
#define RAPIDJSON_NEW(TypeName)
! customization point for global new
Definition: rapidjson.h:606
char * stackEnd_
Definition: stack.h:220
size_t GetCapacity() const
Definition: stack.h:178
T * End()
Definition: stack.h:156
RAPIDJSON_FORCEINLINE void Reserve(size_t count=1)
Definition: stack.h:115
size_t GetSize() const
Definition: stack.h:177
size_t initialCapacity_
Definition: stack.h:221
void Swap(T &a, T &b) RAPIDJSON_NOEXCEPT
Custom swap() to avoid dependency on C++ <algorithm> header.
Definition: swap.h:33
#define RAPIDJSON_DELETE(x)
! customization point for global delete
Definition: rapidjson.h:610
Allocator * allocator_
Definition: stack.h:216
Allocator & GetAllocator()
Definition: stack.h:171
T * Bottom()
Definition: stack.h:162
Definition: document.h:406
char * stackTop_
Definition: stack.h:219
void ShrinkToFit()
Definition: stack.h:100
Stack(Allocator *allocator, size_t stackCapacity)
Definition: stack.h:40
const T * Top() const
Definition: stack.h:150
bool Empty() const
Definition: stack.h:176
T * Pop(size_t count)
Definition: stack.h:137
#define RAPIDJSON_UNLIKELY(x)
Compiler branching hint for expression with low probability to be true.
Definition: rapidjson.h:481
bool HasAllocator() const
Definition: stack.h:167
c
Definition: pymoduletest.py:79
T * Top()
Definition: stack.h:144
void Swap(Stack &rhs) RAPIDJSON_NOEXCEPT
Definition: stack.h:89