This repository has been archived on 2023-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
GestionProjet/includes/Projet.hpp

44 lines
1.1 KiB
C++
Raw Normal View History

2023-10-19 23:05:11 +02:00
#ifndef TP5_PROJET_HPP
#define TP5_PROJET_HPP 1
#include <iostream>
2023-10-24 16:47:59 +02:00
#include <vector>
#include <utility>
#include "../includes/Tache.hpp"
2023-10-19 23:05:11 +02:00
class Projet {
2023-10-24 16:47:59 +02:00
//Héritage de tache ?
//Tache fin;
2023-10-26 19:08:00 +02:00
std::vector<Tache *, bool> taches;
2023-10-19 23:05:11 +02:00
friend std::ostream &operator<<(std::ostream &, const Projet &);
public:
2023-10-26 19:08:00 +02:00
Projet();
Projet(std::vector<Tache *, bool> taches); // constructor
2023-10-19 23:05:11 +02:00
virtual ~Projet(); // destructor
Projet(const Projet &); // copy constructor
const Projet &operator=(const Projet &); // copy assignement
2023-10-24 16:47:59 +02:00
2023-10-26 19:08:00 +02:00
std::vector<Tache *, bool> getTaches(){
return taches;
}
2023-10-24 16:47:59 +02:00
// Retourne une paire d'indentifiants de tâches au hasard
std::pair <int, int> pick_two_random_tasks();
// Indique pour une tâche si elle fait partie du projet
2023-10-26 19:08:00 +02:00
Tache* Projet::contains(int id);
2023-10-24 16:47:59 +02:00
// Donne une version du vecteur de tâches non modifiable
2023-10-26 19:08:00 +02:00
const std::vector<Tache *, bool> consult_tasks() const{
return taches;
};
// Corrige les éventuelles anomalies du vector de tâches
const std::vector<Tache *, bool> topologicalSort();
2023-10-19 23:05:11 +02:00
};
#endif