//============================================================================
// Name        : curriculum_vitae.cpp
// Author      : Marco Calenda
// Version     : 2.0
// Description : Marco Calenda's curriculum vitae.
//               This edition actually compiles and runs:
//                   g++ -std=c++20 curriculum_vitae.cpp -o cv && ./cv
//============================================================================

#include <iostream>
#include <string>
#include <vector>
#include <map>

class Calenda {
    public:
        virtual ~Calenda() = default;
        virtual void print() const = 0;
};

class Marco : public Calenda {
    private:
        std::string fullname = "Marco Calenda";
        std::string birthday = "18/10/1991";
        std::string address  = "Via San Martino n.13/5, Pieve di Soligo (TV), Italia";
        std::string email    = "grievertime@gmail.com";
        std::string linkedin = "linkedin.com/in/marcocalenda";

    public:
        Marco() : Calenda() {
            /*
             * Technical Diploma @ "ITIS Max Planck"
             *                   @ "Electronics & Telecommunications" (2005-2010)
             * Bachelor Degree   @ "Universita degli Studi di Padova"
             *                   @ "Information Engineering"          (2011-2014)
             *     thesis: "Acquisizione, filtraggio e interpretazione
             *              di segnali mioelettrici" (2013)
             */
        }

        // --- Working experience (all concurrent, same industrial group) ------
        struct Job { std::string period, role, company, location; };
        std::vector<Job> work_experience;
        void set_work_experience() {
            work_experience = {
                { "since 10/2013", "Senior Software & Systems Engineer | R&D",
                                   "Rotas Italia S.R.L.", "Treviso, IT" },
                { "since 10/2013", "Firmware & Middleware Engineer",
                                   "IDnova S.R.L.", "Remote" },
                { "since 10/2013", "Software Consultant",
                                   "Rotas Iberica", "Remote, ES" },
            };
        }

        // --- Language skills, spoken_skill and reading_skill from 0 to 5 -----
        struct language { int spoken_skill; int reading_skill; };
        language italian = { .spoken_skill = 5, .reading_skill = 5 };
        language english = { .spoken_skill = 4, .reading_skill = 5 }; // Full Professional
        language spanish = { .spoken_skill = 1, .reading_skill = 2 }; // Elementary

        // --- Technical skills, luckily 99% also passions ---------------------
        std::vector<std::string> it_skills = {
            "C++, C, embedded firmware, real-time control, BLE/RFID",
            "Python, full-stack web, REST APIs, ERP architecture",
            "computer vision, automated industrial quality control",
            "machine learning, multi-agent AI, RAG, MCP, LLM tooling",
            "industrial IoT: Modbus, OPC-UA, MQTT",
        };

        // --- One patent I'm rather proud of ----------------------------------
        std::string patent =
            "IT No. 102023000005175 - raised decorative elements on labels via "
            "3D-printed molds & thermoplastic micro-injection (co-inventor)";

        // --- Personal interests and side projects ----------------------------
        std::vector<std::string> interests = {
            "Building an autonomous ROS 2 ground vehicle",
            "Radio astronomy and satellite reception (SDR)",
        };

        void print() const override {
            std::cout << fullname << '\n'
                      << "Senior Software & Systems Engineer\n"
                      << "born " << birthday << "  |  " << address << '\n'
                      << email << "  |  " << linkedin << "\n\n";

            std::cout << "MOTTO\n"
                      << "  \"Don't be afraid to be less useful compared to your creations.\"\n\n";

            std::cout << "EXPERIENCE\n";
            for (const auto& j : work_experience)
                std::cout << "  [" << j.period << "]  " << j.role
                          << " @ " << j.company << " (" << j.location << ")\n";

            std::cout << "\nTECHNICAL SKILLS\n";
            for (const auto& s : it_skills)
                std::cout << "  - " << s << '\n';

            std::cout << "\nLANGUAGES (spoken/reading, 0-5)\n";
            const std::map<std::string, language> spoken = {
                { "Italian", italian }, { "English", english }, { "Spanish", spanish },
            };
            for (const auto& [name, lang] : spoken)
                std::cout << "  " << name << ": "
                          << lang.spoken_skill << '/' << lang.reading_skill << '\n';

            std::cout << "\nPATENT\n  " << patent << '\n';

            std::cout << "\nINTERESTS\n";
            for (const auto& item : interests)
                std::cout << "  - " << item << '\n';
        }

        ~Marco() override {
            /*
             * Thanks for the attention.
             * I authorize the processing of my personal data.
             * KEYWORDS: software; c++; systems; embedded; firmware; AI; ML;
             *           computer-vision; robotics; ROS2; SDR; radio-astronomy;
             *           ERP; IoT; patent
             */
        }
};

int main() {
    Marco marco;
    marco.set_work_experience();
    marco.print();
    return 0;
}
