db/Interface: add attribute "plugin"
The new method IsPlugin() replaces the "is_simple" flag.
This commit is contained in:
@@ -23,6 +23,9 @@
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
LazyDatabase::LazyDatabase(Database *_db)
|
||||
:Database(_db->GetPlugin()), db(_db), open(false) {}
|
||||
|
||||
LazyDatabase::~LazyDatabase()
|
||||
{
|
||||
assert(!open);
|
||||
|
@@ -35,8 +35,7 @@ class LazyDatabase final : public Database {
|
||||
|
||||
public:
|
||||
gcc_nonnull_all
|
||||
LazyDatabase(Database *_db)
|
||||
:db(_db), open(false) {}
|
||||
LazyDatabase(Database *_db);
|
||||
|
||||
virtual ~LazyDatabase();
|
||||
|
||||
|
@@ -91,7 +91,8 @@ class ProxyDatabase final : public Database, SocketMonitor, IdleMonitor {
|
||||
|
||||
public:
|
||||
ProxyDatabase(EventLoop &_loop, DatabaseListener &_listener)
|
||||
:SocketMonitor(_loop), IdleMonitor(_loop),
|
||||
:Database(proxy_db_plugin),
|
||||
SocketMonitor(_loop), IdleMonitor(_loop),
|
||||
listener(_listener) {}
|
||||
|
||||
static Database *Create(EventLoop &loop, DatabaseListener &listener,
|
||||
|
@@ -40,6 +40,10 @@
|
||||
|
||||
static constexpr Domain simple_db_domain("simple_db");
|
||||
|
||||
inline SimpleDatabase::SimpleDatabase()
|
||||
:Database(simple_db_plugin),
|
||||
path(AllocatedPath::Null()) {}
|
||||
|
||||
Database *
|
||||
SimpleDatabase::Create(gcc_unused EventLoop &loop,
|
||||
gcc_unused DatabaseListener &listener,
|
||||
|
@@ -50,8 +50,7 @@ class SimpleDatabase : public Database {
|
||||
mutable unsigned borrowed_song_count;
|
||||
#endif
|
||||
|
||||
SimpleDatabase()
|
||||
:path(AllocatedPath::Null()) {}
|
||||
SimpleDatabase();
|
||||
|
||||
public:
|
||||
gcc_pure
|
||||
|
@@ -75,6 +75,8 @@ class UpnpDatabase : public Database {
|
||||
UPnPDeviceDirectory *discovery;
|
||||
|
||||
public:
|
||||
UpnpDatabase():Database(upnp_db_plugin) {}
|
||||
|
||||
static Database *Create(EventLoop &loop, DatabaseListener &listener,
|
||||
const config_param ¶m,
|
||||
Error &error);
|
||||
|
Reference in New Issue
Block a user