TuringSim
C++ framework to simulate abstract computing models
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TuringSim::Memory::InvalidFactorException Class Reference

Exception thrown when a size factor is set to an illegal value. More...

#include <memory/memoryStructure.h>

Inheritance diagram for TuringSim::Memory::InvalidFactorException:
Inheritance graph
[legend]
Collaboration diagram for TuringSim::Memory::InvalidFactorException:
Collaboration graph
[legend]

Public Member Functions

 InvalidFactorException ()=delete
 An InvalidFactorException must contain an error message and the offending size factor.
 
 InvalidFactorException (std::string message, size_t sizeFactor)
 Build an InvalidFactorException from an error message and an offending size factor. More...
 
size_t getIllegalSizeFactor () const noexcept
 Return the illegal factor. More...
 
- Public Member Functions inherited from TuringSim::Utils::MessageException
 MessageException ()=delete
 a message exception must have an explicative message.
 
 MessageException (std::string message) noexcept
 Builds a MessageException with a message. More...
 
 MessageException (const MessageException &e)=default
 Copy constructor. More...
 
 MessageException (MessageException &&e)=default
 Move constructor. More...
 
 ~MessageException () noexcept override=default
 Destructor.
 
std::string getMessage () const
 Get the full error message. More...
 
const char * what () const noexcept override
 Get the full error message. More...
 
 operator std::string () const
 Get the full error message. More...
 

Protected Member Functions

virtual std::string makeFullMessage () const override
 Build the full error message. It should be overridden by derived class that adds data to the exception. More...
 

Protected Attributes

size_t sizeFactor
 The illegal factor.
 
- Protected Attributes inherited from TuringSim::Utils::MessageException
std::string msg
 The error message.
 
std::optional< std::string > fullMsg
 The optional full message. Empty until first request.
 

Detailed Description

Exception thrown when a size factor is set to an illegal value.

Definition at line 22 of file memoryStructure.h.

Constructor & Destructor Documentation

◆ InvalidFactorException()

TuringSim::Memory::InvalidFactorException::InvalidFactorException ( std::string  message,
size_t  sizeFactor 
)
inline

Build an InvalidFactorException from an error message and an offending size factor.

Parameters
[in]messageExplicative error message.
[in]sizeFactorThe requested illegal sizeFactor.

Definition at line 32 of file memoryStructure.h.

Member Function Documentation

◆ getIllegalSizeFactor()

size_t TuringSim::Memory::InvalidFactorException::getIllegalSizeFactor ( ) const
inlinenoexcept

Return the illegal factor.

Returns
the illegal factor.

Definition at line 37 of file memoryStructure.h.

◆ makeFullMessage()

virtual std::string TuringSim::Memory::InvalidFactorException::makeFullMessage ( ) const
inlineoverrideprotectedvirtual

Build the full error message. It should be overridden by derived class that adds data to the exception.

Returns
the full error message.

This is called the first time the full error is requested, the result is then memoized.

Reimplemented from TuringSim::Utils::MessageException.

Definition at line 41 of file memoryStructure.h.


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