aboutsummaryrefslogtreecommitdiffstats
path: root/src/Instance.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-02-01 00:26:34 +0100
committerMax Kellermann <max@duempel.org>2014-02-04 11:22:33 +0100
commitcf6281a5a758e4b93d67f7fd5804a8cff60ddbf9 (patch)
tree7368011b1ecf5ae6db6dcafb676fddf03ff9d823 /src/Instance.hxx
parentf00710a57e80738c33255eaa1347ab776fbce869 (diff)
downloadmpd-cf6281a5a758e4b93d67f7fd5804a8cff60ddbf9.tar.gz
mpd-cf6281a5a758e4b93d67f7fd5804a8cff60ddbf9.tar.xz
mpd-cf6281a5a758e4b93d67f7fd5804a8cff60ddbf9.zip
Instance: add Database attribute
Move from db/DatabaseGlue.cxx, eliminating global variable.
Diffstat (limited to '')
-rw-r--r--src/Instance.hxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Instance.hxx b/src/Instance.hxx
index ea60072cb..9e3f92458 100644
--- a/src/Instance.hxx
+++ b/src/Instance.hxx
@@ -30,9 +30,11 @@ class NeighborGlue;
#ifdef ENABLE_DATABASE
#include "db/DatabaseListener.hxx"
+class Database;
class UpdateService;
#endif
+class Error;
class ClientList;
struct Partition;
@@ -55,6 +57,8 @@ struct Instance final
#endif
#ifdef ENABLE_DATABASE
+ Database *database;
+
UpdateService *update;
#endif
@@ -69,6 +73,12 @@ struct Instance final
}
#ifdef ENABLE_DATABASE
+ /**
+ * Returns the global #Database instance. May return nullptr
+ * if this MPD configuration has no database (no
+ * music_directory was configured).
+ */
+ Database *GetDatabase(Error &error);
void DeleteSong(const char *uri);