|
TuringSim
C++ framework to simulate abstract computing models
|
Base class for all memory structures. More...
#include <memory/memoryStructure.h>
Public Types | |
| typedef O | Observer |
| The type of observers. | |
| typedef M | Modifier |
| The type of modifiers. | |
| typedef T | SymbolType |
| The alphabet type. More... | |
Public Member Functions | |
| ~MemoryStructure () | |
| Release current observers and modifier. | |
| const std::set< Observer * > & | getObservers () const noexcept |
| Gets the set of observers. More... | |
| const std::optional< Modifier * > & | getModifier () const noexcept |
| Gets the optional modifier. More... | |
Public Attributes | |
| friend | Observer |
| Observer class. | |
| friend | Modifier |
| Modifier class. | |
Friends | |
| class | MemoryObserver< D, O > |
| class | MemoryModifier< D, M > |
Base class for all memory structures.
| T | the type of symbols. |
| D | the type of the memory structure. |
| O | the type of the memory observer. |
| M | the type of the memory modifier. |
Track the set of observers which have access to the memory structure, and the optional modifier. It ensures, along with MemoryObserver and MemoryModifier, that there is at most one modifier on each memory structure. This restriction holds because concurrent modifications may change the memory structure to an illegal state. Concurrent read/write are still allowed and may result in incoherent read, but the memory structure will stay in a legal state.
Definition at line 117 of file memoryStructure.h.
| typedef T TuringSim::Memory::MemoryStructure< T, D, O, M >::SymbolType |
The alphabet type.
Provide a common name to access the alphabet type from a memory structure.
Definition at line 135 of file memoryStructure.h.
|
inlinenoexcept |
Gets the optional modifier.
Definition at line 158 of file memoryStructure.h.
|
inlinenoexcept |
Gets the set of observers.
Definition at line 151 of file memoryStructure.h.