#ifndef NALOGA0201_GALLERY_H #define NALOGA0201_GALLERY_H #include "Artwork.h" #include "Painting.h" #include "Literature.h" #include "PaintingLiterature.h" #include #include #include struct PrintIfPainting { void operator()(std::shared_ptr e) { std::shared_ptr derived; derived = std::dynamic_pointer_cast(e); if (derived) { 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(std::shared_ptr artwork); void printArtworks() const; std::string toString() const; int getSize() const; void sort(std::function, std::shared_ptr)> c); std::shared_ptr find(std::function)> c); void printArtworks(PrintIfPainting i); void filterOut(std::function)> c); }; #endif //NALOGA0201_GALLERY_H