Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef PLANER_H
- #define PLANER_H
- #include <set>
- #include <string>
- #include <vector>
- #include <list>
- #include <ostream>
- namespace lab2
- {
- class zasob
- {
- std::string nazwa;
- int rozmiar;
- public:
- inline zasob(std::string n, int r) : nazwa(n), rozmiar(r) {}
- friend std::ostream& operator<<(std::ostream& out, const zasob& z);
- //Dodać składowe potrzebne, aby można było utworzyć std::set<zasob>
- friend bool operator<(const zasob& z1, const zasob& z2);
- };
- class zadanie
- {
- public:
- std::string nazwa;
- int koszt;
- std::set<zasob> potrzebne_zasoby;
- // W etapie 2 dodać konstruktor publiczny pozwalający na utworzenie instancji zadania
- // z trzema argumentami -- nazwą, kosztem (mają po prostu zostać przypisane do odpowiednich pól)
- // i listą inicjującą zasobów, która utworzy
- // zbiór potrzebne_zasoby
- // Wywołanie konstruktora jest w main.cpp w liniach 43-45.
- zadanie(std::string nazwa, int koszt, std::initializer_list<zasob> l) : nazwa(nazwa), koszt(koszt), potrzebne_zasoby(l) {};
- // Można dodać inne potrzebne składowe.
- };
- // Ten operator potrzebny jest w etapie 1
- std::ostream& operator<<(std::ostream& out, const std::set<zasob>& s);
- // Ten operator przyda się przy implementacji analogicznego operatora dla klasy
- // projekt w etapie 3
- std::ostream& operator<<(std::ostream& out, const zadanie& z);
- class projekt
- {
- std::set<zasob> dostepne_zasoby;
- std::vector<zadanie> wykonane_zadania;
- std::list<zadanie> zadania_w_toku;
- public:
- // Dodać składowe wymagane a odpowiednich etapach i ewentualne składowe pomocnicze
- bool dodaj_zasob(zasob z);
- const std::set<zasob>& pobierz_dostepne_zasoby() const;
- bool usun_zasob(zasob z);
- bool czy_da_sie_zrealizowac(zadanie z);
- };
- // Dodać potrzebne funkcje i ewentualne funkcje pomocnicze
- }
- #endif /* PLANER_H */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement