From f5ae1ce00b85699291a7cdf9782574e70a8c28f5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 19 Jan 2014 10:51:34 +0100 Subject: LightSong: new class to be used by DatabasePlugin callbacks Detach the Song class completely from the public API, only to be used by SimpleDatabase and the update thread. --- src/db/SimpleDatabasePlugin.hxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/db/SimpleDatabasePlugin.hxx') diff --git a/src/db/SimpleDatabasePlugin.hxx b/src/db/SimpleDatabasePlugin.hxx index d51174194..509b91e4e 100644 --- a/src/db/SimpleDatabasePlugin.hxx +++ b/src/db/SimpleDatabasePlugin.hxx @@ -22,6 +22,7 @@ #include "DatabasePlugin.hxx" #include "fs/AllocatedPath.hxx" +#include "LightSong.hxx" #include "Compiler.h" #include @@ -36,6 +37,11 @@ class SimpleDatabase : public Database { time_t mtime; + /** + * A buffer for GetSong(). + */ + mutable LightSong light_song; + #ifndef NDEBUG mutable unsigned borrowed_song_count; #endif @@ -60,9 +66,9 @@ public: virtual bool Open(Error &error) override; virtual void Close() override; - virtual Song *GetSong(const char *uri_utf8, - Error &error) const override; - virtual void ReturnSong(Song *song) const; + virtual const LightSong *GetSong(const char *uri_utf8, + Error &error) const override; + virtual void ReturnSong(const LightSong *song) const; virtual bool Visit(const DatabaseSelection &selection, VisitDirectory visit_directory, -- cgit v1.2.3