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

Observer for the Stack class. More...

#include <memory/stack.h>

Public Member Functions

constexpr StackObserver (const Stack< T > &stack)
 Construct an observer for the stack in parameter. More...
 
constexpr size_t getSize () const
 Return the current size of the stack. More...
 
constexpr size_t getFreeSpace () const
 Return the unused allocated stack. More...
 
constexpr size_t getAllocatedSize () const
 Return the allocated space. More...
 
constexpr const std::vector< T > & getStack () const
 Return the stack. More...
 
constexpr bool getEnabledFree () const
 Check whether the stack deallocate space when the used space is small enough. More...
 
constexpr size_t getSizeFactor () const
 Get the size factor. More...
 

Detailed Description

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

Observer for the Stack class.

Definition at line 429 of file stack.h.

Constructor & Destructor Documentation

◆ StackObserver()

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

Construct an observer for the stack in parameter.

Parameters
[in]stackthe stack to bind.

The stack is captured by const reference.

Definition at line 437 of file stack.h.

Member Function Documentation

◆ getAllocatedSize()

template<typename T >
constexpr size_t TuringSim::Memory::Stack::StackObserver< T >::getAllocatedSize ( ) const
inlineconstexpr

Return the allocated space.

Returns
the allocated size on the stack.

Definition at line 449 of file stack.h.

◆ getEnabledFree()

template<typename T >
constexpr bool TuringSim::Memory::Stack::StackObserver< T >::getEnabledFree ( ) const
inlineconstexpr

Check whether the stack deallocate space when the used space is small enough.

Returns
whether free is enabled.

Definition at line 457 of file stack.h.

◆ getFreeSpace()

template<typename T >
constexpr size_t TuringSim::Memory::Stack::StackObserver< T >::getFreeSpace ( ) const
inlineconstexpr

Return the unused allocated stack.

Returns
the free space on the stack.

Definition at line 445 of file stack.h.

◆ getSize()

template<typename T >
constexpr size_t TuringSim::Memory::Stack::StackObserver< T >::getSize ( ) const
inlineconstexpr

Return the current size of the stack.

Returns
the size of the stack.

Definition at line 441 of file stack.h.

◆ getSizeFactor()

template<typename T >
constexpr size_t TuringSim::Memory::Stack::StackObserver< T >::getSizeFactor ( ) const
inlineconstexpr

Get the size factor.

Returns
the current size factor.

Definition at line 461 of file stack.h.

◆ getStack()

template<typename T >
constexpr const std::vector<T>& TuringSim::Memory::Stack::StackObserver< T >::getStack ( ) const
inlineconstexpr

Return the stack.

Returns
a const reference to the stack.

Definition at line 453 of file stack.h.


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