From 929187436b3440519b1cd5e656d6c5cdd7cef4cc Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sat, 28 Oct 2023 03:56:31 +0200 Subject: [PATCH] preparation for avis --- includes/Consultant.hpp | 2 ++ includes/Expert.hpp | 2 ++ includes/Gestionnaire.hpp | 5 ++++- src/Consultant.cpp | 7 ++++++- src/Expert.cpp | 7 ++++++- src/Gestionnaire.cpp | 2 +- src/main.cpp | 5 ++--- 7 files changed, 23 insertions(+), 7 deletions(-) diff --git a/includes/Consultant.hpp b/includes/Consultant.hpp index 2871db6..ec30191 100644 --- a/includes/Consultant.hpp +++ b/includes/Consultant.hpp @@ -12,6 +12,8 @@ public: Consultant(const Consultant &); // copy constructor const Consultant &operator=(const Consultant &); // copy assignement + + virtual std::pair, int> avis(const RunProjet &projet); }; #endif diff --git a/includes/Expert.hpp b/includes/Expert.hpp index c2d19fb..36b12a2 100644 --- a/includes/Expert.hpp +++ b/includes/Expert.hpp @@ -12,6 +12,8 @@ public: Expert(const Expert &); // copy constructor const Expert &operator=(const Expert &); // copy assignement + + virtual std::pair, int> avis(const RunProjet &projet); }; #endif diff --git a/includes/Gestionnaire.hpp b/includes/Gestionnaire.hpp index b563b38..1f43ccf 100644 --- a/includes/Gestionnaire.hpp +++ b/includes/Gestionnaire.hpp @@ -1,7 +1,7 @@ #ifndef TP5_GESTIONNAIRE_HPP #define TP5_GESTIONNAIRE_HPP 1 -#include +#include "RunProjet.hpp" class Gestionnaire { friend std::ostream &operator<<(std::ostream &, const Gestionnaire &); @@ -12,6 +12,9 @@ public: Gestionnaire(const Gestionnaire &); // copy constructor const Gestionnaire &operator=(const Gestionnaire &); // copy assignement + + // Renvoie l'ordonnancement et la durée totale restante + virtual std::pair, int> avis(const RunProjet &) = 0; }; #endif diff --git a/src/Consultant.cpp b/src/Consultant.cpp index dafe6cf..47c02cf 100644 --- a/src/Consultant.cpp +++ b/src/Consultant.cpp @@ -1,6 +1,6 @@ #include "../includes/Consultant.hpp" -Consultant::Consultant() { std::cout << "Hello, Consultant!\n"; } +Consultant::Consultant() {} Consultant::~Consultant() {} @@ -13,3 +13,8 @@ const Consultant &Consultant::operator=(const Consultant &src) { return *this; } + +std::pair, int> Consultant::avis(const RunProjet &projet) { + // TODO + return std::make_pair(std::vector(), 0); +} diff --git a/src/Expert.cpp b/src/Expert.cpp index a9fa5d1..41adc9e 100644 --- a/src/Expert.cpp +++ b/src/Expert.cpp @@ -1,6 +1,6 @@ #include "../includes/Expert.hpp" -Expert::Expert() { std::cout << "Hello, Expert!\n"; } +Expert::Expert() {} Expert::~Expert() {} @@ -13,3 +13,8 @@ const Expert &Expert::operator=(const Expert &src) { return *this; } + +std::pair, int> Expert::avis(const RunProjet &projet) { + // TODO + return std::make_pair(std::vector(), 0); +} diff --git a/src/Gestionnaire.cpp b/src/Gestionnaire.cpp index 91ac278..13d45dc 100644 --- a/src/Gestionnaire.cpp +++ b/src/Gestionnaire.cpp @@ -1,6 +1,6 @@ #include "../includes/Gestionnaire.hpp" -Gestionnaire::Gestionnaire() { std::cout << "Hello, Gestionnaire!\n"; } +Gestionnaire::Gestionnaire() {} Gestionnaire::~Gestionnaire() {} diff --git a/src/main.cpp b/src/main.cpp index 4a5fde4..94ad871 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,5 @@ #include "../includes/Consultant.hpp" #include "../includes/Expert.hpp" -#include "../includes/RunProjet.hpp" using namespace std; @@ -19,11 +18,11 @@ int main() { cout << "----- verification : ProtoProjet vide " << endl; cout << pp << endl; - /* Consultant c; + Consultant c; cout << c.avis(rp).second << endl; // dira 25 Expert e; - cout << e.avis(rp).second << endl; // dira 15 */ + cout << e.avis(rp).second << endl; // dira 15 return EXIT_SUCCESS; }