ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
Public Member Functions | Private Attributes | List of all members
etiss::ExpandingNativeStack< T, stackallocatedsize > Class Template Reference

implements a stack that may only grow (if needed) and can only contain native types since no destructor / contructor / initialization is called. More...

#include <ObjectPool.h>

Collaboration diagram for etiss::ExpandingNativeStack< T, stackallocatedsize >:
Collaboration graph
[legend]

Public Member Functions

 ExpandingNativeStack ()
 
 ~ExpandingNativeStack ()
 
operator[] (ssize_t pos)
 
const T operator[] (size_t pos) const
 
ssize_t pos () const
 
ssize_t size () const
 
ssize_t capacity () const
 
T & back ()
 
const T & back () const
 
T & front ()
 
const T & front () const
 
void pop ()
 
void push (T t)
 
bool empty () const
 

Private Attributes

stackbuf_ [stackallocatedsize > 0 ? stackallocatedsize :1]
 
T * stack_
 
size_t size_
 
ssize_t pos_
 

Detailed Description

template<typename T, size_t stackallocatedsize = 1>
class etiss::ExpandingNativeStack< T, stackallocatedsize >

implements a stack that may only grow (if needed) and can only contain native types since no destructor / contructor / initialization is called.

if this object is allocated on the stack heap allocations may be preventd by using the stackallocatedsize parameter to allocate an initial integrated storage

Definition at line 241 of file ObjectPool.h.

Constructor & Destructor Documentation

◆ ExpandingNativeStack()

template<typename T , size_t stackallocatedsize = 1>
etiss::ExpandingNativeStack< T, stackallocatedsize >::ExpandingNativeStack ( )
inline

Definition at line 253 of file ObjectPool.h.

◆ ~ExpandingNativeStack()

template<typename T , size_t stackallocatedsize = 1>
etiss::ExpandingNativeStack< T, stackallocatedsize >::~ExpandingNativeStack ( )
inline

Member Function Documentation

◆ back() [1/2]

template<typename T , size_t stackallocatedsize = 1>
T& etiss::ExpandingNativeStack< T, stackallocatedsize >::back ( )
inline

◆ back() [2/2]

template<typename T , size_t stackallocatedsize = 1>
const T& etiss::ExpandingNativeStack< T, stackallocatedsize >::back ( ) const
inline

◆ capacity()

template<typename T , size_t stackallocatedsize = 1>
ssize_t etiss::ExpandingNativeStack< T, stackallocatedsize >::capacity ( ) const
inline

◆ empty()

template<typename T , size_t stackallocatedsize = 1>
bool etiss::ExpandingNativeStack< T, stackallocatedsize >::empty ( ) const
inline

◆ front() [1/2]

template<typename T , size_t stackallocatedsize = 1>
T& etiss::ExpandingNativeStack< T, stackallocatedsize >::front ( )
inline

◆ front() [2/2]

template<typename T , size_t stackallocatedsize = 1>
const T& etiss::ExpandingNativeStack< T, stackallocatedsize >::front ( ) const
inline

◆ operator[]() [1/2]

template<typename T , size_t stackallocatedsize = 1>
const T etiss::ExpandingNativeStack< T, stackallocatedsize >::operator[] ( size_t  pos) const
inline

◆ operator[]() [2/2]

template<typename T , size_t stackallocatedsize = 1>
T etiss::ExpandingNativeStack< T, stackallocatedsize >::operator[] ( ssize_t  pos)
inline

◆ pop()

template<typename T , size_t stackallocatedsize = 1>
void etiss::ExpandingNativeStack< T, stackallocatedsize >::pop ( )
inline

Definition at line 282 of file ObjectPool.h.

References ETISS_SRCLOC, etiss::FATALERROR, etiss::log(), etiss::ExpandingNativeStack< T, stackallocatedsize >::pos_, and unlikely.

Here is the call graph for this function:

◆ pos()

template<typename T , size_t stackallocatedsize = 1>
ssize_t etiss::ExpandingNativeStack< T, stackallocatedsize >::pos ( ) const
inline

Definition at line 275 of file ObjectPool.h.

References etiss::ExpandingNativeStack< T, stackallocatedsize >::pos_.

Referenced by etiss::ExpandingNativeStack< T, stackallocatedsize >::operator[]().

Here is the caller graph for this function:

◆ push()

template<typename T , size_t stackallocatedsize = 1>
void etiss::ExpandingNativeStack< T, stackallocatedsize >::push ( t)
inline

◆ size()

template<typename T , size_t stackallocatedsize = 1>
ssize_t etiss::ExpandingNativeStack< T, stackallocatedsize >::size ( ) const
inline

Member Data Documentation

◆ pos_

template<typename T , size_t stackallocatedsize = 1>
ssize_t etiss::ExpandingNativeStack< T, stackallocatedsize >::pos_
private

◆ size_

template<typename T , size_t stackallocatedsize = 1>
size_t etiss::ExpandingNativeStack< T, stackallocatedsize >::size_
private

◆ stack_

template<typename T , size_t stackallocatedsize = 1>
T* etiss::ExpandingNativeStack< T, stackallocatedsize >::stack_
private

◆ stackbuf_

template<typename T , size_t stackallocatedsize = 1>
T etiss::ExpandingNativeStack< T, stackallocatedsize >::stackbuf_[stackallocatedsize > 0 ? stackallocatedsize :1]
private

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