#ifndef GENREREPOSITORY_H_ #define GENREREPOSITORY_H_ #include #include #include #include "database/BaseRepository.h" #include "model/Models.h" #include "type/GenreFilter.h" namespace database { class GenreRepository : public BaseRepository { public: GenreRepository(const model::BinaryPath&); std::vector retrieveRecords(); std::pair retrieveRecordWithSongCount(model::Genre&, type::GenreFilter); model::Genre retrieveRecord(model::Genre&, type::GenreFilter); bool doesGenreExist(const model::Genre&, type::GenreFilter); void saveRecord(const model::Genre&); void deleteRecord(const model::Genre&, type::GenreFilter); private: std::vector parseRecords(MYSQL_STMT*); std::pair parseRecordWithSongCount(MYSQL_STMT*); std::shared_ptr valueBind(model::Genre&, std::tuple&); std::shared_ptr valueBindWithSongCount(model::Genre&, std::tuple&, int&); std::tuple metadataBuffer(); model::Genre parseRecord(MYSQL_STMT*); }; } #endif