EnigmaMachineCore 0.1.0
A modular Enigma Machine simulation in C++20
Loading...
Searching...
No Matches
PlugBoard.hpp
Go to the documentation of this file.
1
6#pragma once
7
8#include <array>
9
10#include "EnigmaTypes.hpp"
11#include "PlugBoardPair.hpp"
12#include "config.hpp"
13
22class PlugBoard {
23private:
24 std::array<AlphabetIndex, TRANSFORMER_SIZE> mapping; // Direct mapping: mapping[Input] = Output
25
26public:
31 PlugBoard();
32
41 explicit PlugBoard(const std::array<PlugBoardPair, PLUGBOARD_MAX_PAIRS>& pairs);
42 ~PlugBoard() = default;
43
50 AlphabetIndex swap(AlphabetIndex key) const;
51};
Header file for the PlugBoardPair struct.
Class representing the PlugBoard (Steckerbrett) of the Enigma machine.
Definition PlugBoard.hpp:22
AlphabetIndex swap(AlphabetIndex key) const
Swaps the input key based on the plugboard pairs.
Definition PlugBoard.cpp:55
PlugBoard()
Constructor for the PlugBoard class. Initializes an empty plugboard with no pairs (identity mapping).
Definition PlugBoard.cpp:13
std::array< AlphabetIndex, TRANSFORMER_SIZE > mapping
Definition PlugBoard.hpp:24
~PlugBoard()=default
Global configuration constants for the Enigma machine.