diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-05-16 14:11:38 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-05-16 14:11:38 +1000 |
| commit | d71f726c42963d55809605b4dc4144970ca0f230 (patch) | |
| tree | 5dc8e6355f5e870e767c3d23ec4009bc39155821 /src/database/include/song.hpp | |
| parent | 785349eb5b3255d0a51ca7459531f75cb47c90ac (diff) | |
| download | tangara-fw-d71f726c42963d55809605b4dc4144970ca0f230.tar.gz | |
Add pagination to database queries
Diffstat (limited to 'src/database/include/song.hpp')
| -rw-r--r-- | src/database/include/song.hpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/database/include/song.hpp b/src/database/include/song.hpp index e51e5587..9a84e124 100644 --- a/src/database/include/song.hpp +++ b/src/database/include/song.hpp @@ -4,6 +4,7 @@ #include <optional> #include <string> +#include <utility> #include "leveldb/db.h" #include "span.hpp" @@ -133,16 +134,20 @@ class SongData { */ class Song { public: - Song(SongData data, SongTags tags) : data_(data), tags_(tags) {} + Song(const SongData& data, const SongTags& tags) : data_(data), tags_(tags) {} + Song(const Song& other) = default; - auto data() -> const SongData& { return data_; } - auto tags() -> const SongTags& { return tags_; } + auto data() const -> const SongData& { return data_; } + auto tags() const -> const SongTags& { return tags_; } bool operator==(const Song&) const = default; + Song operator=(const Song& other) const { return Song(other); } private: const SongData data_; const SongTags tags_; }; +void swap(Song& first, Song& second); + } // namespace database |
