diff options
author | Max Kellermann <max@duempel.org> | 2014-01-18 16:08:30 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-01-18 16:08:30 +0100 |
commit | 7d696a7063c7510485f2fbf315731212d28e49e0 (patch) | |
tree | d10dcbaea5ae2a5896086da142b6bed06acd5e26 /src/db/upnp/Discovery.hxx | |
parent | 53573e950f74f482bbbb594aa4516de050dc4e34 (diff) | |
download | mpd-7d696a7063c7510485f2fbf315731212d28e49e0.tar.gz mpd-7d696a7063c7510485f2fbf315731212d28e49e0.tar.xz mpd-7d696a7063c7510485f2fbf315731212d28e49e0.zip |
db/upnp/Discovery: eliminate Error attribute
Move code to method Start() and add Error& parameters to several
methods.
Diffstat (limited to 'src/db/upnp/Discovery.hxx')
-rw-r--r-- | src/db/upnp/Discovery.hxx | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/src/db/upnp/Discovery.hxx b/src/db/upnp/Discovery.hxx index edda3a8de..59eed9331 100644 --- a/src/db/upnp/Discovery.hxx +++ b/src/db/upnp/Discovery.hxx @@ -82,8 +82,6 @@ class UPnPDeviceDirectory { LibUPnP *const lib; - Error error; - Mutex mutex; std::map<std::string, ContentDirectoryDescriptor> directories; WorkQueue<DiscoveredTask *> discoveredQueue; @@ -103,8 +101,10 @@ public: UPnPDeviceDirectory(const UPnPDeviceDirectory &) = delete; UPnPDeviceDirectory& operator=(const UPnPDeviceDirectory &) = delete; + bool Start(Error &error); + /** Retrieve the directory services currently seen on the network */ - bool getDirServices(std::vector<ContentDirectoryService> &); + bool getDirServices(std::vector<ContentDirectoryService> &, Error &); /** * Get server by friendly name. It's a bit wasteful to copy @@ -112,27 +112,18 @@ public: * there isn't going to be millions... */ bool getServer(const char *friendlyName, - ContentDirectoryService &server); - - /** My health */ - bool ok() const { - return !error.IsDefined(); - } - - /** My diagnostic if health is bad */ - const Error &GetError() const { - return error; - } + ContentDirectoryService &server, + Error &error); private: - bool search(); + bool search(Error &error); /** * Look at the devices and get rid of those which have not * been seen for too long. We do this when listing the top * directory. */ - void expireDevices(); + bool expireDevices(Error &error); /** * Worker routine for the discovery queue. Get messages about |