#ifndef NALOGA0201_GALLERY_H #define NALOGA0201_GALLERY_H #include "Artwork.h" #include "Painting.h" #include "Literature.h" #include #include struct PrintIfPainting{ void operator()(Artwork* e){ if(auto* derived = dynamic_cast (e)){ std::cout << derived->toString() << "\n"; } } }; class Gallery { private: std::string name; std::vector 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 filteredVector(bool (*c)(Artwork*)); }; #endif //NALOGA0201_GALLERY_H