input/qobuz: use class IntrusiveList
This commit is contained in:
		| @@ -25,15 +25,14 @@ | ||||
| #include "lib/curl/Init.hxx" | ||||
| #include "thread/Mutex.hxx" | ||||
| #include "event/DeferEvent.hxx" | ||||
|  | ||||
| #include <boost/intrusive/list.hpp> | ||||
| #include "util/IntrusiveList.hxx" | ||||
|  | ||||
| #include <memory> | ||||
| #include <map> | ||||
| #include <string> | ||||
|  | ||||
| class QobuzSessionHandler | ||||
| 	: public boost::intrusive::list_base_hook<boost::intrusive::link_mode<boost::intrusive::safe_link>> | ||||
| 	: public SafeLinkIntrusiveListHook | ||||
| { | ||||
| public: | ||||
| 	virtual void OnQobuzSession() noexcept = 0; | ||||
| @@ -59,8 +58,7 @@ class QobuzClient final : QobuzLoginHandler { | ||||
|  | ||||
| 	std::exception_ptr error; | ||||
|  | ||||
| 	typedef boost::intrusive::list<QobuzSessionHandler, | ||||
| 				       boost::intrusive::constant_time_size<false>> LoginHandlerList; | ||||
| 	using LoginHandlerList = IntrusiveList<QobuzSessionHandler>; | ||||
|  | ||||
| 	LoginHandlerList handlers; | ||||
|  | ||||
| @@ -87,7 +85,7 @@ public: | ||||
| 	void RemoveLoginHandler(QobuzSessionHandler &h) noexcept { | ||||
| 		const std::lock_guard<Mutex> protect(mutex); | ||||
| 		if (h.is_linked()) | ||||
| 			handlers.erase(handlers.iterator_to(h)); | ||||
| 			h.unlink(); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Max Kellermann
					Max Kellermann