TuringSim
C++ framework to simulate abstract computing models
Public Member Functions | List of all members
TuringSim::Memory::Stack::StackModifier< T > Class Template Reference

Modifier for the Stack class. More...

#include <memory/stack.h>

Public Member Functions

constexpr StackModifier (Stack< T > &stack)
 Construct an modifier for the stack in parameter. More...
 
constexpr void allocate () const
 Allocate space on the stack. More...
 
constexpr void allocate (size_t additionalSize) const
 Allocate e boxes on the stack. More...
 
constexpr void shrink () const
 Deallocate all unused space.
 
constexpr void disableFree () const
 Disable the deallocating.
 
constexpr void enableFree () const
 Enable the deallocating.
 
constexpr void setSizeFactor (size_t newSizeFactor)
 Set the size factor. More...
 

Detailed Description

template<typename T>
class TuringSim::Memory::Stack::StackModifier< T >

Modifier for the Stack class.

Definition at line 468 of file stack.h.

Constructor & Destructor Documentation

◆ StackModifier()

template<typename T >
constexpr TuringSim::Memory::Stack::StackModifier< T >::StackModifier ( Stack< T > &  stack)
inlineconstexpr

Construct an modifier for the stack in parameter.

Parameters
[in]stackthe stack to bind.

The stack is captured by reference.

Definition at line 476 of file stack.h.

Member Function Documentation

◆ allocate() [1/2]

template<typename T >
constexpr void TuringSim::Memory::Stack::StackModifier< T >::allocate ( ) const
inlineconstexpr

Allocate space on the stack.

Multiply the allocated space by the size factor.

Definition at line 481 of file stack.h.

◆ allocate() [2/2]

template<typename T >
constexpr void TuringSim::Memory::Stack::StackModifier< T >::allocate ( size_t  additionalSize) const
inlineconstexpr

Allocate e boxes on the stack.

Parameters
[in]additionalSizethe size to allocate.

Definition at line 485 of file stack.h.

◆ setSizeFactor()

template<typename T >
constexpr void TuringSim::Memory::Stack::StackModifier< T >::setSizeFactor ( size_t  newSizeFactor)
inlineconstexpr

Set the size factor.

Parameters
[in]newSizeFactorthe new size factor
Exceptions
TuringSim::Memory::InvalidFactorExceptionif newSizeFactor is less than or equal to 1.

Definition at line 503 of file stack.h.


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