consolidate all repos to one for archive

This commit is contained in:
2025-01-28 13:46:42 +01:00
commit a6610fbc7a
5350 changed files with 2705721 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
#ifndef NALOGA0201_GALLERY_H
#define NALOGA0201_GALLERY_H
#include "Artwork.h"
#include "Painting.h"
#include "Literature.h"
#include <vector>
#include <algorithm>
struct PrintIfPainting{
void operator()(Artwork* e){
if(auto* derived = dynamic_cast<Painting*> (e)){
std::cout << derived->toString() << "\n";
}
}
};
class Gallery {
private:
std::string name;
std::vector<Artwork *> artworks;
public:
Gallery() = default;
explicit Gallery(std::string name);
~Gallery() = default;
void addArtwork(Artwork *artwork);
void printArtworks() const;
std::string toString() const;
void sort(bool (*c)(Artwork*, Artwork*));
void printArtworks(PrintIfPainting i);
Artwork* find(bool (*c)(Artwork*));
std::vector<Artwork *> filteredVector(bool (*c)(Artwork*));
};
#endif //NALOGA0201_GALLERY_H