EnigmaMachineCore 0.1.0
A modular Enigma Machine simulation in C++20
Loading...
Searching...
No Matches
Public Member Functions | List of all members
IEnigmaObserver Struct Referenceabstract

Interface for observing Enigma Machine events. Implement this interface to receive notifications about state changes. More...

#include <IEnigmaObserver.hpp>

+ Inheritance diagram for IEnigmaObserver:

Public Member Functions

virtual ~IEnigmaObserver ()
 
virtual void onRotorStepped (int rotorIndex, AlphabetIndex position)=0
 Called when a rotor steps.
 
virtual void onCharEncrypted (char input, char output)=0
 Called when a character is encrypted/decrypted.
 

Detailed Description

Interface for observing Enigma Machine events. Implement this interface to receive notifications about state changes.

Definition at line 10 of file IEnigmaObserver.hpp.

Constructor & Destructor Documentation

◆ ~IEnigmaObserver()

IEnigmaObserver::~IEnigmaObserver ( )
virtualdefault

Member Function Documentation

◆ onCharEncrypted()

virtual void IEnigmaObserver::onCharEncrypted ( char  input,
char  output 
)
pure virtual

Called when a character is encrypted/decrypted.

Parameters
inputThe original input character.
outputThe final output character.

Implemented in ConsoleObserver, and EnigmaMachine.

◆ onRotorStepped()

virtual void IEnigmaObserver::onRotorStepped ( int  rotorIndex,
AlphabetIndex  position 
)
pure virtual

Called when a rotor steps.

Parameters
rotorIndexThe index of the rotor (0 is the rightmost/fastest).
positionThe new position of the rotor (0-25).

Implemented in ConsoleObserver, and EnigmaMachine.


The documentation for this struct was generated from the following files: