TuringSim
C++ framework to simulate abstract computing models
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TuringSim::Memory::ExistingModifierException< Memory, Modifier > Class Template Reference

Exception thrown when attempting to bound a modifier to a memory structure that is already bound to another modifier. More...

#include <memory/memoryStructure.h>

Inheritance diagram for TuringSim::Memory::ExistingModifierException< Memory, Modifier >:
Inheritance graph
[legend]
Collaboration diagram for TuringSim::Memory::ExistingModifierException< Memory, Modifier >:
Collaboration graph
[legend]

Public Member Functions

 ExistingModifierException ()=delete
 An ExistingModifierException must contain an error message, a pointer to the memory structure, and a pointer to the existing modifier.
 
 ExistingModifierException (std::string message, const Memory *memory, const Modifier *modifier)
 Build an ExistingModifierException from an error message, a pointer to the memory structure, and a pointer to the existing modifier. More...
 
const Memory * getMemory () const
 Access the memory structure. More...
 
const Modifier * getModifier () const
 Access the existing modifier. 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

const Memory * memory
 The involved memory structure.
 
const Modifier * modifier
 The other modifier.
 
- 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

template<typename Memory, typename Modifier>
class TuringSim::Memory::ExistingModifierException< Memory, Modifier >

Exception thrown when attempting to bound a modifier to a memory structure that is already bound to another modifier.

Template Parameters
Memorythe type of the memory structure.
Modifierthe type of the memory modifier.

Definition at line 57 of file memoryStructure.h.

Constructor & Destructor Documentation

◆ ExistingModifierException()

template<typename Memory , typename Modifier >
TuringSim::Memory::ExistingModifierException< Memory, Modifier >::ExistingModifierException ( std::string  message,
const Memory *  memory,
const Modifier *  modifier 
)
inline

Build an ExistingModifierException from an error message, a pointer to the memory structure, and a pointer to the existing modifier.

Parameters
[in]messageexplicative error message.
[in]memorythe memory structure.
[in]modifierthe existing modifier.

Definition at line 68 of file memoryStructure.h.

Member Function Documentation

◆ getMemory()

template<typename Memory , typename Modifier >
const Memory* TuringSim::Memory::ExistingModifierException< Memory, Modifier >::getMemory ( ) const
inline

Access the memory structure.

Returns
A pointer to the memory structure to which the modifier tried to bind.

Definition at line 75 of file memoryStructure.h.

◆ getModifier()

template<typename Memory , typename Modifier >
const Modifier* TuringSim::Memory::ExistingModifierException< Memory, Modifier >::getModifier ( ) const
inline

Access the existing modifier.

Returns
A pointer to the existing modifier.

Definition at line 82 of file memoryStructure.h.

◆ makeFullMessage()

template<typename Memory , typename Modifier >
virtual std::string TuringSim::Memory::ExistingModifierException< Memory, Modifier >::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 87 of file memoryStructure.h.


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