//============================================================================
// Name        : cv.cpp
// Author      : Marco Calenda
// Version     : 3.0
// Description : Marco Calenda's curriculum vitae, as a small C++ program.
//               Build & run:
//                   g++ -std=c++20 cv.cpp -o cv && ./cv
//============================================================================

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

namespace cv {

struct Education {
    std::string period, qualification, field, institution;
};

struct Job {
    std::string period, role, company, location;
};

struct Language {
    std::string name;
    int spoken, reading;  // 0..5
};

class Calenda {
protected:
    std::string surname = "Calenda";
};

class Marco : public Calenda {
    friend std::ostream& operator<<(std::ostream&, const Marco&);

    std::string name     = "Marco";
    std::string headline = "Senior Software & Systems Engineer";
    std::string birthday = "18/10/1991";
    std::string address  = "Pieve di Soligo (TV), Italia";
    std::string email    = "ciao@marcocalenda.com";
    std::string linkedin = "linkedin.com/in/marcocalenda";
    std::string motto    = "Don't be afraid to be less useful than your creations.";

    std::vector<Education> education = {
        { "2005-2010", "Technical Diploma", "Electronics & Telecommunications",
          "ITIS Max Planck" },
        { "2011-2014", "Bachelor's Degree", "Information Engineering",
          "Universita degli Studi di Padova" },
    };

    // All concurrent, same industrial group.
    std::vector<Job> experience = {
        { "10/2013-08/2026", "Senior Software & Systems Engineer | R&D | Technical Lead",
          "Rotas Italia S.R.L.", "Treviso, IT" },
        { "10/2013-08/2026", "Firmware & Middleware Engineer",
          "IDnova S.R.L.", "Remote" },
        { "10/2013-08/2026", "Software Consultant",
          "Rotas Iberica", "Remote, ES" },
    };

    // Luckily 99% also passions.
    std::vector<std::string> skills = {
        "C++, C, embedded firmware, real-time control, BLE/RFID",
        "Python, full-stack web, REST APIs, ERP/CRM/MES architecture",
        "computer vision, automated industrial quality control",
        "machine learning, multi-agent AI, RAG, MCP, LLM tooling",
        "genetic algorithms, triple-crossover, dynamic parameter optimisation, production scheduling",
        "industrial IoT: Modbus, OPC-UA, MQTT",
    };

    std::vector<Language> languages = {
        { "Italian", 5, 5 },  // native
        { "English", 4, 5 },  // full professional
    };

    std::string patent =
        "IT No. 102023000005175 (granted 2025) - raised decorative elements on "
        "physical supports (e.g. labels) via 3D-printed molds & thermoplastic "
        "micro-injection (co-inventor)";

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

std::ostream& operator<<(std::ostream& os, const Marco& m) {
    os << m.name << ' ' << m.surname << '\n'
       << m.headline << '\n'
       << "born " << m.birthday << "  |  " << m.address << '\n'
       << m.email << "  |  " << m.linkedin << "\n\n";

    os << "MOTTO\n  \"" << m.motto << "\"\n\n";

    os << "EDUCATION\n";
    for (const auto& e : m.education)
        os << "  [" << e.period << "]  " << e.qualification
           << " in " << e.field << " @ " << e.institution << '\n';

    os << "\nEXPERIENCE\n";
    for (const auto& j : m.experience)
        os << "  [" << j.period << "]  " << j.role
           << " @ " << j.company << " (" << j.location << ")\n";

    os << "\nTECHNICAL SKILLS\n";
    for (const auto& s : m.skills)
        os << "  - " << s << '\n';

    os << "\nLANGUAGES (spoken/reading, 0-5)\n";
    for (const auto& l : m.languages)
        os << "  " << l.name << ": " << l.spoken << '/' << l.reading << '\n';

    os << "\nPATENT\n  " << m.patent << '\n';

    os << "\nINTERESTS\n";
    for (const auto& i : m.interests)
        os << "  - " << i << '\n';

    os << "\nAutorizzo il trattamento dei dati personali (GDPR, Reg. UE 2016/679).\n";
    return os;
}

}  // namespace cv

int main() {
    std::cout << cv::Marco{};
    // KEYWORDS: software; c++; systems; embedded; firmware; AI; ML;
    //           computer-vision; robotics; ROS2; SDR; radio-astronomy; ERP; IoT; patent
}
