Public Member Functions | Private Member Functions | Private Attributes | List of all members
internal::Stack< Allocator > Class Template Reference

A type-unsafe stack for storing different types of data. More...

#include <stack.h>

Public Member Functions

template<typename T >
T * Bottom ()
 
template<typename T >
const T * Bottom () const
 
void Clear ()
 
bool Empty () const
 
template<typename T >
T * End ()
 
template<typename T >
const T * End () const
 
Allocator & GetAllocator ()
 
size_t GetCapacity () const
 
size_t GetSize () const
 
bool HasAllocator () const
 
template<typename T >
T * Pop (size_t count)
 
template<typename T >
RAPIDJSON_FORCEINLINE T * Push (size_t count=1)
 
template<typename T >
RAPIDJSON_FORCEINLINE T * PushUnsafe (size_t count=1)
 
template<typename T >
RAPIDJSON_FORCEINLINE void Reserve (size_t count=1)
 
void ShrinkToFit ()
 
 Stack (Allocator *allocator, size_t stackCapacity)
 
void Swap (Stack &rhs) RAPIDJSON_NOEXCEPT
 
template<typename T >
T * Top ()
 
template<typename T >
const T * Top () const
 
 ~Stack ()
 

Private Member Functions

void Destroy ()
 
template<typename T >
void Expand (size_t count)
 
Stackoperator= (const Stack &)
 
void Resize (size_t newCapacity)
 
 Stack (const Stack &)
 

Private Attributes

Allocator * allocator_
 
size_t initialCapacity_
 
Allocator * ownAllocator_
 
char * stack_
 
char * stackEnd_
 
char * stackTop_
 

Detailed Description

template<typename Allocator>
class internal::Stack< Allocator >

A type-unsafe stack for storing different types of data.

Template Parameters
AllocatorAllocator for allocating stack memory.

Definition at line 37 of file stack.h.

Constructor & Destructor Documentation

template<typename Allocator>
internal::Stack< Allocator >::Stack ( Allocator *  allocator,
size_t  stackCapacity 
)
inline

Definition at line 42 of file stack.h.

template<typename Allocator>
internal::Stack< Allocator >::~Stack ( )
inline

Definition at line 65 of file stack.h.

template<typename Allocator>
internal::Stack< Allocator >::Stack ( const Stack< Allocator > &  )
private

Member Function Documentation

template<typename Allocator>
template<typename T >
T* internal::Stack< Allocator >::Bottom ( )
inline

Definition at line 186 of file stack.h.

template<typename Allocator>
template<typename T >
const T* internal::Stack< Allocator >::Bottom ( ) const
inline

Definition at line 192 of file stack.h.

template<typename Allocator>
void internal::Stack< Allocator >::Clear ( )
inline

Definition at line 105 of file stack.h.

template<typename Allocator>
void internal::Stack< Allocator >::Destroy ( )
inlineprivate

Definition at line 253 of file stack.h.

template<typename Allocator>
bool internal::Stack< Allocator >::Empty ( ) const
inline

Definition at line 208 of file stack.h.

template<typename Allocator>
template<typename T >
T* internal::Stack< Allocator >::End ( )
inline

Definition at line 174 of file stack.h.

template<typename Allocator>
template<typename T >
const T* internal::Stack< Allocator >::End ( ) const
inline

Definition at line 180 of file stack.h.

template<typename Allocator>
template<typename T >
void internal::Stack< Allocator >::Expand ( size_t  count)
inlineprivate

Definition at line 223 of file stack.h.

template<typename Allocator>
Allocator& internal::Stack< Allocator >::GetAllocator ( )
inline

Definition at line 202 of file stack.h.

template<typename Allocator>
size_t internal::Stack< Allocator >::GetCapacity ( ) const
inline

Definition at line 216 of file stack.h.

template<typename Allocator>
size_t internal::Stack< Allocator >::GetSize ( ) const
inline

Definition at line 212 of file stack.h.

template<typename Allocator>
bool internal::Stack< Allocator >::HasAllocator ( ) const
inline

Definition at line 197 of file stack.h.

template<typename Allocator>
Stack& internal::Stack< Allocator >::operator= ( const Stack< Allocator > &  )
private
template<typename Allocator>
template<typename T >
T* internal::Stack< Allocator >::Pop ( size_t  count)
inline

Definition at line 152 of file stack.h.

template<typename Allocator>
template<typename T >
RAPIDJSON_FORCEINLINE T* internal::Stack< Allocator >::Push ( size_t  count = 1)
inline

Definition at line 135 of file stack.h.

template<typename Allocator>
template<typename T >
RAPIDJSON_FORCEINLINE T* internal::Stack< Allocator >::PushUnsafe ( size_t  count = 1)
inline

Definition at line 142 of file stack.h.

template<typename Allocator>
template<typename T >
RAPIDJSON_FORCEINLINE void internal::Stack< Allocator >::Reserve ( size_t  count = 1)
inline

Definition at line 127 of file stack.h.

template<typename Allocator>
void internal::Stack< Allocator >::Resize ( size_t  newCapacity)
inlineprivate

Definition at line 245 of file stack.h.

template<typename Allocator>
void internal::Stack< Allocator >::ShrinkToFit ( )
inline

Definition at line 110 of file stack.h.

template<typename Allocator>
void internal::Stack< Allocator >::Swap ( Stack< Allocator > &  rhs)
inline

Definition at line 95 of file stack.h.

template<typename Allocator>
template<typename T >
T* internal::Stack< Allocator >::Top ( )
inline

Definition at line 160 of file stack.h.

template<typename Allocator>
template<typename T >
const T* internal::Stack< Allocator >::Top ( ) const
inline

Definition at line 167 of file stack.h.

Member Data Documentation

template<typename Allocator>
Allocator* internal::Stack< Allocator >::allocator_
private

Definition at line 263 of file stack.h.

template<typename Allocator>
size_t internal::Stack< Allocator >::initialCapacity_
private

Definition at line 268 of file stack.h.

template<typename Allocator>
Allocator* internal::Stack< Allocator >::ownAllocator_
private

Definition at line 264 of file stack.h.

template<typename Allocator>
char* internal::Stack< Allocator >::stack_
private

Definition at line 265 of file stack.h.

template<typename Allocator>
char* internal::Stack< Allocator >::stackEnd_
private

Definition at line 267 of file stack.h.

template<typename Allocator>
char* internal::Stack< Allocator >::stackTop_
private

Definition at line 266 of file stack.h.


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


xbot_talker
Author(s): wangxiaoyun
autogenerated on Sat Oct 10 2020 03:27:54