|
Home / Open source / Terimber 2.0
_stack< T, A > Class Template Referenceclass stack uses external allocator class for ALL internal memory allocations only 4 byte size for empty stack object
More...
#include <stack.h>
List of all members.
|
Public Member Functions |
| | _stack () |
| | constructor
|
| | ~_stack () |
| | destructor
|
| | _stack (const _stack< T, A > &x) |
| | copy constructor copies only pointers to head element NO reallocation or copy of memory
|
| _stack< T, A > & | operator= (const _stack< T, A > &x) |
| | assign operator copy only pointers to head element NO reallocation or copy of memory
|
| size_t | size () |
| | gets size - expensive operation use empty instead
|
| TYPENAME _stack< T, A >::iterator | push (A &allocator_, const T &x) |
| | inserts new object to the top of stack
|
| bool | pop () |
| | removes first element from stack no memory deallocation
|
| bool | pop (node_allocator< TYPENAME base_stack< T >::_node > &allocator_) |
| | removes first element from stack memory deallocation on external allocator
|
Protected Member Functions |
| TYPENAME _stack< T, A >::_node * | _buynode (byte_allocator &allocator_, const T &x) |
| | allocates node on byte_allocator
|
| TYPENAME _stack< T, A >::_node * | _buynode (node_allocator< TYPENAME base_stack< T >::_node > &allocator_, const T &x) |
| | allocates node on node_allocator
|
| void | _freenode (node_allocator< TYPENAME base_stack< T >::_node > &allocator_, TYPENAME _stack< T, A >::_node *p) |
| | deallocates node on node_allocator
|
Detailed Description
template<class T, class A = byte_allocator>
class _stack< T, A >
class stack uses external allocator class for ALL internal memory allocations only 4 byte size for empty stack object
Definition at line 300 of file stack.h.
Constructor & Destructor Documentation
template<class T, class A>
template<class T, class A>
template<class T, class A>
copy constructor copies only pointers to head element NO reallocation or copy of memory
Definition at line 168 of file stack.hpp.
Member Function Documentation
template<class T, class A>
template<class T, class A>
| size_t _stack< T, A >::size |
( |
|
) |
[inline] |
template<class T, class A>
inserts new object to the top of stack
- Parameters:
-
| allocator_ |
external allocator |
| x |
object |
Definition at line 207 of file stack.hpp.
References _stack< T, A >::_buynode(), base_stack< T >::_head, base_stack< T >::_node_::_next, base_stack< T >::end(), and TYPENAME.
Referenced by xml_document::container_push(), xml_document::container_reset(), xml_document::container_start_doctype(), cluster_processor< T, N >::cut(), xml_processor::parseAttributes(), xml_persistor::persist(), xml_persistor::persistDocType(), xml_persistor::persistDocument(), xml_persistor::persistElement(), and xml_persistor::restore_stack().
template<class T, class A>
| bool _stack< T, A >::pop |
( |
|
) |
[inline] |
template<class T, class A>
template<class T, class A>
template<class T, class A>
template<class T, class A>
The documentation for this class was generated from the following files:
|
|