# sozahra/cpp-module-05 architecture

> Architecture diagram of the GitHub repository sozahra/cpp-module-05, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sozahra/cpp-module-05
- Repository: https://github.com/sozahra/cpp-module-05

## Overview

This repository is a sequence of C++ exercises that incrementally build a bureaucratic form-processing model: grade-checked bureaucrats, signable forms, executable form types, and finally an intern that creates forms by name. Each exercise has its own demo entry point. The supplied excerpts show the demos and interfaces; implementation-level links below are limited to relationships supported by the source index or those excerpts.

Main entry points: [`ex03/main.cpp`](https://github.com/sozahra/cpp-module-05/blob/main/ex03/main.cpp) (Form factory demo), [`ex02/main.cpp`](https://github.com/sozahra/cpp-module-05/blob/main/ex02/main.cpp) (Execution demo), [`ex03/Intern.cpp`](https://github.com/sozahra/cpp-module-05/blob/main/ex03/Intern.cpp) (Form-making intern), [`ex02/AForm.cpp`](https://github.com/sozahra/cpp-module-05/blob/main/ex02/AForm.cpp) (Abstract form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_grades["Grade control"]
  node_demo00["Grade demo<br/>[main.cpp]"]
  node_bureaucrat00["Bureaucrat<br/>[Bureaucrat.cpp]"]
end

subgraph group_signing["Form signing"]
  node_demo01["Signing demo<br/>[main.cpp]"]
  node_bureaucrat01["Bureaucrat<br/>[Bureaucrat.cpp]"]
  node_form01["Signable form<br/>[Form.cpp]"]
end

subgraph group_execution["Form execution"]
  node_demo02["Execution demo<br/>[main.cpp]"]
  node_bureaucrat02["Bureaucrat<br/>[Bureaucrat.cpp]"]
  node_abstract02["Abstract form<br/>[AForm.cpp]"]
  node_pardon02["Pardon form"]
  node_robotomy02["Robotomy form"]
  node_shrubbery02["Shrubbery form"]
end

subgraph group_creation["Form creation"]
  node_demo03["Form factory demo<br/>[main.cpp]"]
  node_bureaucrat03["Bureaucrat<br/>[Bureaucrat.cpp]"]
  node_abstract03["Abstract form<br/>[AForm.cpp]"]
  node_pardon03["Pardon form"]
  node_robotomy03["Robotomy form"]
  node_shrubbery03["Shrubbery form"]
  node_intern["Form-making intern<br/>[Intern.cpp]"]
end

node_operator(("Demo operator"))

node_operator -->|"runs"| node_demo00
node_demo00 -->|"creates"| node_bureaucrat00
node_operator -->|"runs"| node_demo01
node_demo01 -->|"creates"| node_bureaucrat01
node_demo01 -->|"signs"| node_form01
node_bureaucrat01 -->|"signs via"| node_form01
node_operator -->|"runs"| node_demo02
node_demo02 -->|"creates"| node_bureaucrat02
node_demo02 -->|"creates"| node_pardon02
node_demo02 -->|"creates"| node_robotomy02
node_demo02 -->|"creates"| node_shrubbery02
node_bureaucrat02 -->|"signs and executes"| node_abstract02
node_pardon02 -->|"inherits"| node_abstract02
node_robotomy02 -->|"inherits"| node_abstract02
node_shrubbery02 -->|"inherits"| node_abstract02
node_operator -->|"runs"| node_demo03
node_demo03 -->|"requests forms"| node_intern
node_intern -->|"creates"| node_pardon03
node_intern -->|"creates"| node_robotomy03
node_intern -->|"creates"| node_shrubbery03
node_demo03 -->|"creates"| node_bureaucrat03
node_bureaucrat03 -->|"signs and executes"| node_abstract03
node_demo03 -->|"signs and executes"| node_pardon03
node_demo03 -->|"signs and executes"| node_robotomy03
node_demo03 -->|"signs and executes"| node_shrubbery03
node_pardon03 -->|"inherits"| node_abstract03
node_robotomy03 -->|"inherits"| node_abstract03
node_shrubbery03 -->|"inherits"| node_abstract03

click node_demo00 "https://github.com/sozahra/cpp-module-05/blob/main/ex00/main.cpp"
click node_bureaucrat00 "https://github.com/sozahra/cpp-module-05/blob/main/ex00/Bureaucrat.cpp"
click node_demo01 "https://github.com/sozahra/cpp-module-05/blob/main/ex01/main.cpp"
click node_bureaucrat01 "https://github.com/sozahra/cpp-module-05/blob/main/ex01/Bureaucrat.cpp"
click node_form01 "https://github.com/sozahra/cpp-module-05/blob/main/ex01/Form.cpp"
click node_demo02 "https://github.com/sozahra/cpp-module-05/blob/main/ex02/main.cpp"
click node_bureaucrat02 "https://github.com/sozahra/cpp-module-05/blob/main/ex02/Bureaucrat.cpp"
click node_abstract02 "https://github.com/sozahra/cpp-module-05/blob/main/ex02/AForm.cpp"
click node_pardon02 "https://github.com/sozahra/cpp-module-05/blob/main/ex02/PresidentialPardonForm.cpp"
click node_robotomy02 "https://github.com/sozahra/cpp-module-05/blob/main/ex02/RobotomyRequestForm.cpp"
click node_shrubbery02 "https://github.com/sozahra/cpp-module-05/blob/main/ex02/ShrubberyCreationForm.cpp"
click node_demo03 "https://github.com/sozahra/cpp-module-05/blob/main/ex03/main.cpp"
click node_bureaucrat03 "https://github.com/sozahra/cpp-module-05/blob/main/ex03/Bureaucrat.cpp"
click node_abstract03 "https://github.com/sozahra/cpp-module-05/blob/main/ex03/AForm.cpp"
click node_pardon03 "https://github.com/sozahra/cpp-module-05/blob/main/ex03/PresidentialPardonForm.cpp"
click node_robotomy03 "https://github.com/sozahra/cpp-module-05/blob/main/ex03/RobotomyRequestForm.cpp"
click node_shrubbery03 "https://github.com/sozahra/cpp-module-05/blob/main/ex03/ShrubberyCreationForm.cpp"
click node_intern "https://github.com/sozahra/cpp-module-05/blob/main/ex03/Intern.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_demo00,node_bureaucrat00 toneBlue
class node_demo01,node_bureaucrat01,node_form01 toneAmber
class node_demo02,node_bureaucrat02,node_abstract02,node_pardon02,node_robotomy02,node_shrubbery02 toneMint
class node_demo03,node_bureaucrat03,node_abstract03,node_pardon03,node_robotomy03,node_shrubbery03,node_intern toneRose
class node_operator toneIndigo
```

## Components

### Grade control

- [Grade demo](https://github.com/sozahra/cpp-module-05/blob/main/ex00/main.cpp): `ex00/main.cpp`
- [Bureaucrat](https://github.com/sozahra/cpp-module-05/blob/main/ex00/Bureaucrat.cpp): `ex00/Bureaucrat.cpp`

### Form signing

- [Signing demo](https://github.com/sozahra/cpp-module-05/blob/main/ex01/main.cpp): `ex01/main.cpp`
- [Bureaucrat](https://github.com/sozahra/cpp-module-05/blob/main/ex01/Bureaucrat.cpp): `ex01/Bureaucrat.cpp`
- [Signable form](https://github.com/sozahra/cpp-module-05/blob/main/ex01/Form.cpp): `ex01/Form.cpp`

### Form execution

- [Execution demo](https://github.com/sozahra/cpp-module-05/blob/main/ex02/main.cpp): `ex02/main.cpp`
- [Bureaucrat](https://github.com/sozahra/cpp-module-05/blob/main/ex02/Bureaucrat.cpp): `ex02/Bureaucrat.cpp`
- [Abstract form](https://github.com/sozahra/cpp-module-05/blob/main/ex02/AForm.cpp): `ex02/AForm.cpp`
- [Pardon form](https://github.com/sozahra/cpp-module-05/blob/main/ex02/PresidentialPardonForm.cpp): `ex02/PresidentialPardonForm.cpp`
- [Robotomy form](https://github.com/sozahra/cpp-module-05/blob/main/ex02/RobotomyRequestForm.cpp): `ex02/RobotomyRequestForm.cpp`
- [Shrubbery form](https://github.com/sozahra/cpp-module-05/blob/main/ex02/ShrubberyCreationForm.cpp): `ex02/ShrubberyCreationForm.cpp`

### Form creation

- [Form factory demo](https://github.com/sozahra/cpp-module-05/blob/main/ex03/main.cpp): `ex03/main.cpp`
- [Bureaucrat](https://github.com/sozahra/cpp-module-05/blob/main/ex03/Bureaucrat.cpp): `ex03/Bureaucrat.cpp`
- [Abstract form](https://github.com/sozahra/cpp-module-05/blob/main/ex03/AForm.cpp): `ex03/AForm.cpp`
- [Pardon form](https://github.com/sozahra/cpp-module-05/blob/main/ex03/PresidentialPardonForm.cpp): `ex03/PresidentialPardonForm.cpp`
- [Robotomy form](https://github.com/sozahra/cpp-module-05/blob/main/ex03/RobotomyRequestForm.cpp): `ex03/RobotomyRequestForm.cpp`
- [Shrubbery form](https://github.com/sozahra/cpp-module-05/blob/main/ex03/ShrubberyCreationForm.cpp): `ex03/ShrubberyCreationForm.cpp`
- [Form-making intern](https://github.com/sozahra/cpp-module-05/blob/main/ex03/Intern.cpp): `ex03/Intern.cpp`

### Other components

- **Demo operator**

## Connections

- Demo operator → Grade demo: runs (evidence: `ex00/main.cpp`)
- Grade demo → Bureaucrat: creates (evidence: `ex00/main.cpp`)
- Demo operator → Signing demo: runs (evidence: `ex01/main.cpp`)
- Signing demo → Bureaucrat: creates (evidence: `ex01/main.cpp`)
- Signing demo → Signable form: signs (evidence: `ex01/main.cpp`)
- Bureaucrat → Signable form: signs via (evidence: `ex01/Bureaucrat.cpp`)
- Demo operator → Execution demo: runs (evidence: `ex02/main.cpp`)
- Execution demo → Bureaucrat: creates (evidence: `ex02/main.cpp`)
- Execution demo → Pardon form: creates (evidence: `ex02/main.cpp`)
- Execution demo → Robotomy form: creates (evidence: `ex02/main.cpp`)
- Execution demo → Shrubbery form: creates (evidence: `ex02/main.cpp`)
- Bureaucrat → Abstract form: signs and executes (evidence: `ex02/Bureaucrat.cpp`)
- Pardon form → Abstract form: inherits
- Robotomy form → Abstract form: inherits
- Shrubbery form → Abstract form: inherits
- Demo operator → Form factory demo: runs (evidence: `ex03/main.cpp`)
- Form factory demo → Form-making intern: requests forms (evidence: `ex03/main.cpp`)
- Form-making intern → Pardon form: creates (evidence: `ex03/Intern.cpp`)
- Form-making intern → Robotomy form: creates (evidence: `ex03/Intern.cpp`)
- Form-making intern → Shrubbery form: creates (evidence: `ex03/Intern.cpp`)
- Form factory demo → Bureaucrat: creates (evidence: `ex03/main.cpp`)
- Bureaucrat → Abstract form: signs and executes (evidence: `ex03/Bureaucrat.cpp`)
- Form factory demo → Pardon form: signs and executes (evidence: `ex03/main.cpp`)
- Form factory demo → Robotomy form: signs and executes (evidence: `ex03/main.cpp`)
- Form factory demo → Shrubbery form: signs and executes (evidence: `ex03/main.cpp`)
- Pardon form → Abstract form: inherits
- Robotomy form → Abstract form: inherits
- Shrubbery form → Abstract form: inherits
