# medidbella/cpp_modules architecture

> Architecture diagram of the GitHub repository medidbella/cpp_modules, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/medidbella/cpp_modules
- Repository: https://github.com/medidbella/cpp_modules

## Overview

This project is not a typical full-stack system but rather an organized collection of C++ exercises that demonstrate various language features and programming concepts. Each top-level directory (cpp_00, cpp_01, …, cpp_09) corresponds to a module that focuses on a particular theme or set of features in C++ – such as namespaces, memory allocation, operator overloading, inheritance, polymorphism, exceptions, casts, templates, STL usage, and data structures. The README file clearly maps these modules (MODULE 00 through MODULE 09) to their intended learning outcomes.

##### Main Components
- Overall Project Container: Represent the complete collection as “C++ Module Exercises Repository.”
- Underlying Concepts: Optionally, include labels or annotations indicating the central C++ concepts being demonstrated in each module such as:
- cpp_00: Basic constructs (namespaces, classes, streams)
- cpp_01: Memory management and pointers
- cpp_02: Canonical forms and operator overloading
- cpp_03: Inheritance
- cpp_04: Polymorphism (virtual functions, abstract classes)
- cpp_05: Exception handling
- cpp_06: C++ casting operators
- cpp_07: Templates
- cpp_08: STL algorithms, containers, and iterators
- cpp_09: Data structures like map, vector, stack, deque

##### Establish Relationships and Flow
- Although the exercises are fairly independent, illustrate that they are all part of a cohesive educational framework.

##### Architectural and Design Patterns
- That the project follows a modular structure. Even though it isn’t a runtime system, the design pattern is educationally motivated—each module represents a cohesive set of features.
- Point out the conventional use of Makefiles in each exercise which standardizes the build process across modules.

##### Relevant Technologies or Artifacts
- C++ Source Files: Highlight that each exercise has a C++ source (*.cpp) and header (*.hpp or .h) files.
- Makefiles: Represent that these are the build scripts ensuring consistency.
- Testing/Execution: Represent the main.cpp files as entry points for the respective exercise executions.
- Other Elements: For Module 09 there are additional resources (data.csv, input.txt) that demonstrate file handling and data processing.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Overall Repository
    repo["C++ Module Exercises Repository"]:::repo

    %% Module 00
    subgraph "cpp_00: Basic constructs (namespaces, classes, streams)"
        m0["cpp_00: Basic constructs"]:::module
        e0_0["ex00: megaphone.cpp, Makefile"]:::exercise
        e0_1["ex01: Contact.hpp, PhoneBook.cpp, main.cpp"]:::exercise
    end
    repo --> m0
    m0 --> e0_0
    m0 --> e0_1

    %% Module 01
    subgraph "cpp_01: Memory management and pointers"
        m1["cpp_01: Memory management and pointers"]:::module
        e1_0["ex00: Zombie.cpp, main.cpp"]:::exercise
        e1_1["ex01: Zombie.cpp, main.cpp, zombieHorde.cpp"]:::exercise
        e1_2["ex02: main.cpp"]:::exercise
        e1_3["ex03: HumanA.cpp, Weapon.hpp, main.cpp"]:::exercise
        e1_4["ex04: main.cpp, include.hpp"]:::exercise
        e1_5["ex05: Harl.cpp, main.cpp"]:::exercise
        e1_6["ex06: Harl.cpp, main.cpp"]:::exercise
    end
    repo --> m1
    m1 --> e1_0
    m1 --> e1_1
    m1 --> e1_2
    m1 --> e1_3
    m1 --> e1_4
    m1 --> e1_5
    m1 --> e1_6

    %% Module 02
    subgraph "cpp_02: Canonical forms and operator overloading"
        m2["cpp_02: Canonical forms and operator overloading"]:::module
        e2_0["ex00: Fixed.cpp, main.cpp"]:::exercise
        e2_1["ex01: Fixed_arithmitics.cpp, main.cpp"]:::exercise
        e2_2["ex02: main.cpp"]:::exercise
    end
    repo --> m2
    m2 --> e2_0
    m2 --> e2_1
    m2 --> e2_2

    %% Module 03
    subgraph "cpp_03: Inheritance"
        m3["cpp_03: Inheritance"]:::module
        e3_0["ex00: ClapTrap.cpp, main.cpp"]:::exercise
        e3_1["ex01: ClapTrap.cpp, ScavTrap.cpp, main.cpp"]:::exercise
        e3_2["ex02: FragTrap.cpp, main.cpp"]:::exercise
    end
    repo --> m3
    m3 --> e3_0
    m3 --> e3_1
    m3 --> e3_2

    %% Module 04
    subgraph "cpp_04: Polymorphism (virtual functions, abstract classes)"
        m4["cpp_04: Polymorphism"]:::module
        e4_0["ex00: Animal.cpp, Cat.cpp, Dog.cpp, WrongAnimal.cpp, main.cpp"]:::exercise
        e4_1["ex01: Animal.cpp, Brain.cpp, Cat.cpp, Dog.cpp, main.cpp"]:::exercise
        e4_2["ex02: Animal.cpp, Brain.cpp, Cat.cpp, Dog.cpp, main.cpp"]:::exercise
    end
    repo --> m4
    m4 --> e4_0
    m4 --> e4_1
    m4 --> e4_2

    %% Module 05
    subgraph "cpp_05: Exception handling"
        m5["cpp_05: Exception handling"]:::module
        e5_0["ex00: Bureaucrat.cpp, GradeTooHighException.cpp, main.cpp"]:::exercise
        e5_1["ex01: Bureaucrat.cpp, Form.cpp, main.cpp"]:::exercise
        e5_2["ex02: AForm.cpp, PresidentialPardonForm.cpp, main.cpp"]:::exercise
        e5_3["ex03: AForm.cpp, Intern.cpp, main.cpp"]:::exercise
    end
    repo --> m5
    m5 --> e5_0
    m5 --> e5_1
    m5 --> e5_2
    m5 --> e5_3

    %% Module 06
    subgraph "cpp_06: C++ casting operators"
        m6["cpp_06: C++ casting operators"]:::module
        e6_0["ex00: ScalarConverter.cpp, helpers.cpp, main.cpp"]:::exercise
        e6_1["ex01: Serializer.cpp, main.cpp"]:::exercise
        e6_2["ex02: A.cpp, B.cpp, Base.cpp, main.cpp"]:::exercise
    end
    repo --> m6
    m6 --> e6_0
    m6 --> e6_1
    m6 --> e6_2

    %% Module 07
    subgraph "cpp_07: Templates"
        m7["cpp_07: Templates"]:::module
        e7_0["ex00: main.cpp, whatever.hpp"]:::exercise
        e7_1["ex01: Block.cpp, iter.hpp, main.cpp"]:::exercise
        e7_2["ex02: Array.hpp, Block.cpp, InvalidIndexException.cpp, main.cpp"]:::exercise
    end
    repo --> m7
    m7 --> e7_0
    m7 --> e7_1
    m7 --> e7_2

    %% Module 08
    subgraph "cpp_08: STL algorithms, containers, and iterators"
        m8["cpp_08: STL algorithms, containers, and iterators"]:::module
        e8_0["ex00: easyfind.hpp, ElementNotFoundException.cpp, main.cpp"]:::exercise
        e8_1["ex01: Span.cpp, main.cpp"]:::exercise
        e8_2["ex02: MutantStack.hpp, ref.hpp, main.cpp"]:::exercise
    end
    repo --> m8
    m8 --> e8_0
    m8 --> e8_1
    m8 --> e8_2

    %% Module 09
    subgraph "cpp_09: Data structures (map, vector, stack, deque)"
        m9["cpp_09: Data structures"]:::module
        e9_0["ex00: BitcoinExchange.cpp, Date.cpp, data.csv, input.txt, main.cpp"]:::exercise
        e9_1["ex01: RPN.cpp, main.cpp"]:::exercise
        e9_2["ex02: PmergeMe.cpp, main.cpp"]:::exercise
    end
    repo --> m9
    m9 --> e9_0
    m9 --> e9_1
    m9 --> e9_2

    %% Click Events
    click repo "https://github.com/medidbella/cpp_modules/blob/main/README.md"
    click m0 "https://github.com/medidbella/cpp_modules/tree/main/cpp_00"
    click e0_0 "https://github.com/medidbella/cpp_modules/tree/main/cpp_00/ex00"
    click e0_1 "https://github.com/medidbella/cpp_modules/tree/main/cpp_00/ex01"

    click m1 "https://github.com/medidbella/cpp_modules/tree/main/cpp_01"
    click e1_0 "https://github.com/medidbella/cpp_modules/tree/main/cpp_01/ex00"
    click e1_1 "https://github.com/medidbella/cpp_modules/tree/main/cpp_01/ex01"
    click e1_2 "https://github.com/medidbella/cpp_modules/tree/main/cpp_01/ex02"
    click e1_3 "https://github.com/medidbella/cpp_modules/tree/main/cpp_01/ex03"
    click e1_4 "https://github.com/medidbella/cpp_modules/tree/main/cpp_01/ex04"
    click e1_5 "https://github.com/medidbella/cpp_modules/tree/main/cpp_01/ex05"
    click e1_6 "https://github.com/medidbella/cpp_modules/tree/main/cpp_01/ex06"

    click m2 "https://github.com/medidbella/cpp_modules/tree/main/cpp_02"
    click e2_0 "https://github.com/medidbella/cpp_modules/tree/main/cpp_02/ex00"
    click e2_1 "https://github.com/medidbella/cpp_modules/tree/main/cpp_02/ex01"
    click e2_2 "https://github.com/medidbella/cpp_modules/tree/main/cpp_02/ex02"

    click m3 "https://github.com/medidbella/cpp_modules/tree/main/cpp_03"
    click e3_0 "https://github.com/medidbella/cpp_modules/tree/main/cpp_03/ex00"
    click e3_1 "https://github.com/medidbella/cpp_modules/tree/main/cpp_03/ex01"
    click e3_2 "https://github.com/medidbella/cpp_modules/tree/main/cpp_03/ex02"

    click m4 "https://github.com/medidbella/cpp_modules/tree/main/cpp_04"
    click e4_0 "https://github.com/medidbella/cpp_modules/tree/main/cpp_04/ex00"
    click e4_1 "https://github.com/medidbella/cpp_modules/tree/main/cpp_04/ex01"
    click e4_2 "https://github.com/medidbella/cpp_modules/tree/main/cpp_04/ex02"

    click m5 "https://github.com/medidbella/cpp_modules/tree/main/cpp_05"
    click e5_0 "https://github.com/medidbella/cpp_modules/tree/main/cpp_05/ex00"
    click e5_1 "https://github.com/medidbella/cpp_modules/tree/main/cpp_05/ex01"
    click e5_2 "https://github.com/medidbella/cpp_modules/tree/main/cpp_05/ex02"
    click e5_3 "https://github.com/medidbella/cpp_modules/tree/main/cpp_05/ex03"

    click m6 "https://github.com/medidbella/cpp_modules/tree/main/cpp_06"
    click e6_0 "https://github.com/medidbella/cpp_modules/tree/main/cpp_06/ex00"
    click e6_1 "https://github.com/medidbella/cpp_modules/tree/main/cpp_06/ex01"
    click e6_2 "https://github.com/medidbella/cpp_modules/tree/main/cpp_06/ex02"

    click m7 "https://github.com/medidbella/cpp_modules/tree/main/cpp_07"
    click e7_0 "https://github.com/medidbella/cpp_modules/tree/main/cpp_07/ex00"
    click e7_1 "https://github.com/medidbella/cpp_modules/tree/main/cpp_07/ex01"
    click e7_2 "https://github.com/medidbella/cpp_modules/tree/main/cpp_07/ex02"

    click m8 "https://github.com/medidbella/cpp_modules/tree/main/cpp_08"
    click e8_0 "https://github.com/medidbella/cpp_modules/tree/main/cpp_08/ex00"
    click e8_1 "https://github.com/medidbella/cpp_modules/tree/main/cpp_08/ex01"
    click e8_2 "https://github.com/medidbella/cpp_modules/tree/main/cpp_08/ex02"

    click m9 "https://github.com/medidbella/cpp_modules/tree/main/cpp_09"
    click e9_0 "https://github.com/medidbella/cpp_modules/tree/main/cpp_09/ex00"
    click e9_1 "https://github.com/medidbella/cpp_modules/tree/main/cpp_09/ex01"
    click e9_2 "https://github.com/medidbella/cpp_modules/tree/main/cpp_09/ex02"

    %% Styles
    classDef repo fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef module fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef exercise fill:#fff3cd,stroke:#856404,stroke-width:2px;
```
