lib/upnp/Discovery: forward-declare inner class ContentDirectoryDescriptor
This commit is contained in:
parent
f40eb963fd
commit
714dbc9294
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#include "Discovery.hxx"
|
#include "Discovery.hxx"
|
||||||
#include "ContentDirectoryService.hxx"
|
#include "ContentDirectoryService.hxx"
|
||||||
|
#include "Device.hxx"
|
||||||
#include "Log.hxx"
|
#include "Log.hxx"
|
||||||
#include "Error.hxx"
|
#include "Error.hxx"
|
||||||
#include "lib/curl/Global.hxx"
|
#include "lib/curl/Global.hxx"
|
||||||
|
@ -18,6 +19,30 @@
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
class UPnPDeviceDirectory::ContentDirectoryDescriptor {
|
||||||
|
public:
|
||||||
|
std::string id;
|
||||||
|
|
||||||
|
UPnPDevice device;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The time stamp when this device expires.
|
||||||
|
*/
|
||||||
|
std::chrono::steady_clock::time_point expires;
|
||||||
|
|
||||||
|
ContentDirectoryDescriptor() = default;
|
||||||
|
|
||||||
|
ContentDirectoryDescriptor(std::string &&_id,
|
||||||
|
std::chrono::steady_clock::time_point last,
|
||||||
|
std::chrono::steady_clock::duration exp) noexcept
|
||||||
|
:id(std::move(_id)),
|
||||||
|
expires(last + exp + std::chrono::seconds(20)) {}
|
||||||
|
|
||||||
|
void Parse(std::string_view url, std::string_view description) {
|
||||||
|
device.Parse(url, description);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class UPnPDeviceDirectory::Downloader final
|
class UPnPDeviceDirectory::Downloader final
|
||||||
: public IntrusiveListHook<>, CurlResponseHandler
|
: public IntrusiveListHook<>, CurlResponseHandler
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
// Copyright The Music Player Daemon Project
|
// Copyright The Music Player Daemon Project
|
||||||
|
|
||||||
#include "Callback.hxx"
|
#include "Callback.hxx"
|
||||||
#include "Device.hxx"
|
|
||||||
#include "lib/curl/Init.hxx"
|
#include "lib/curl/Init.hxx"
|
||||||
#include "thread/Mutex.hxx"
|
#include "thread/Mutex.hxx"
|
||||||
#include "util/IntrusiveList.hxx"
|
#include "util/IntrusiveList.hxx"
|
||||||
|
@ -31,29 +30,7 @@ class UPnPDeviceDirectory final : UpnpCallback {
|
||||||
* Descriptor for one device having a Content Directory
|
* Descriptor for one device having a Content Directory
|
||||||
* service found on the network.
|
* service found on the network.
|
||||||
*/
|
*/
|
||||||
class ContentDirectoryDescriptor {
|
class ContentDirectoryDescriptor;
|
||||||
public:
|
|
||||||
std::string id;
|
|
||||||
|
|
||||||
UPnPDevice device;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The time stamp when this device expires.
|
|
||||||
*/
|
|
||||||
std::chrono::steady_clock::time_point expires;
|
|
||||||
|
|
||||||
ContentDirectoryDescriptor() = default;
|
|
||||||
|
|
||||||
ContentDirectoryDescriptor(std::string &&_id,
|
|
||||||
std::chrono::steady_clock::time_point last,
|
|
||||||
std::chrono::steady_clock::duration exp) noexcept
|
|
||||||
:id(std::move(_id)),
|
|
||||||
expires(last + exp + std::chrono::seconds(20)) {}
|
|
||||||
|
|
||||||
void Parse(std::string_view url, std::string_view description) {
|
|
||||||
device.Parse(url, description);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class Downloader;
|
class Downloader;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue