NGL  6.5
The NCCA Graphics Library
internal::Stack< Allocator > Class Template Reference

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

#include <stack.h>

+ Inheritance diagram for internal::Stack< Allocator >:
+ Collaboration diagram for internal::Stack< Allocator >:

Public Member Functions

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

Private Member Functions

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

Private Attributes

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

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 31 of file stack.h.

Constructor & Destructor Documentation

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

Definition at line 35 of file stack.h.

+ Here is the caller graph for this function:

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

Definition at line 57 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 135 of file stack.h.

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

Definition at line 94 of file stack.h.

+ Here is the caller graph for this function:

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

Definition at line 176 of file stack.h.

+ Here is the caller graph for this function:

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

Definition at line 145 of file stack.h.

+ Here is the caller graph for this function:

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

Definition at line 151 of file stack.h.

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

Definition at line 141 of file stack.h.

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

Definition at line 147 of file stack.h.

+ Here is the caller graph for this function:

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

Definition at line 146 of file stack.h.

+ Here is the caller graph for this function:

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

Definition at line 137 of file stack.h.

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

+ Here is the caller graph for this function:

template<typename Allocator>
template<typename T >
T* internal::Stack< Allocator >::Pop ( size_t  count)
inline

Definition at line 122 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 111 of file stack.h.

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

Definition at line 169 of file stack.h.

+ Here is the caller graph for this function:

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

Definition at line 96 of file stack.h.

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

Definition at line 85 of file stack.h.

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

Definition at line 129 of file stack.h.

Member Data Documentation

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

Definition at line 185 of file stack.h.

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

Definition at line 190 of file stack.h.

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

Definition at line 186 of file stack.h.

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

Definition at line 187 of file stack.h.

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

Definition at line 189 of file stack.h.

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

Definition at line 188 of file stack.h.


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