input/cache: use IntrusiveList instead of boost::intrusive::list
This commit is contained in:
parent
89d950e9a7
commit
77d257de27
9
src/input/cache/Item.hxx
vendored
9
src/input/cache/Item.hxx
vendored
@ -22,8 +22,8 @@
|
||||
|
||||
#include "input/BufferingInputStream.hxx"
|
||||
#include "thread/Mutex.hxx"
|
||||
#include "util/IntrusiveList.hxx"
|
||||
|
||||
#include <boost/intrusive/list.hpp>
|
||||
#include <boost/intrusive/set_hook.hpp>
|
||||
|
||||
#include <string>
|
||||
@ -39,15 +39,12 @@ class InputCacheLease;
|
||||
*/
|
||||
class InputCacheItem final
|
||||
: public BufferingInputStream,
|
||||
public boost::intrusive::list_base_hook<boost::intrusive::link_mode<boost::intrusive::auto_unlink>>,
|
||||
public AutoUnlinkIntrusiveListHook,
|
||||
public boost::intrusive::set_base_hook<boost::intrusive::link_mode<boost::intrusive::normal_link>>
|
||||
{
|
||||
const std::string uri;
|
||||
|
||||
using LeaseList =
|
||||
boost::intrusive::list<InputCacheLease,
|
||||
boost::intrusive::base_hook<boost::intrusive::list_base_hook<boost::intrusive::link_mode<boost::intrusive::normal_link>>>,
|
||||
boost::intrusive::constant_time_size<false>>;
|
||||
using LeaseList = IntrusiveList<InputCacheLease>;
|
||||
|
||||
LeaseList leases;
|
||||
LeaseList::iterator next_lease = leases.end();
|
||||
|
5
src/input/cache/Lease.hxx
vendored
5
src/input/cache/Lease.hxx
vendored
@ -21,8 +21,7 @@
|
||||
#define MPD_INPUT_CACHE_LEASE_HXX
|
||||
|
||||
#include "Item.hxx"
|
||||
|
||||
#include <boost/intrusive/list_hook.hpp>
|
||||
#include "util/IntrusiveList.hxx"
|
||||
|
||||
#include <utility>
|
||||
|
||||
@ -30,7 +29,7 @@
|
||||
* A lease for an #InputCacheItem.
|
||||
*/
|
||||
class InputCacheLease
|
||||
: public boost::intrusive::list_base_hook<boost::intrusive::link_mode<boost::intrusive::normal_link>>
|
||||
: public IntrusiveListHook
|
||||
{
|
||||
InputCacheItem *item = nullptr;
|
||||
|
||||
|
6
src/input/cache/Manager.hxx
vendored
6
src/input/cache/Manager.hxx
vendored
@ -21,9 +21,9 @@
|
||||
#define MPD_INPUT_CACHE_MANAGER_HXX
|
||||
|
||||
#include "thread/Mutex.hxx"
|
||||
#include "util/IntrusiveList.hxx"
|
||||
|
||||
#include <boost/intrusive/set.hpp>
|
||||
#include <boost/intrusive/list.hpp>
|
||||
|
||||
class InputStream;
|
||||
class InputCacheItem;
|
||||
@ -55,9 +55,7 @@ class InputCacheManager {
|
||||
const InputCacheItem &b) const noexcept;
|
||||
};
|
||||
|
||||
boost::intrusive::list<InputCacheItem,
|
||||
boost::intrusive::base_hook<boost::intrusive::list_base_hook<boost::intrusive::link_mode<boost::intrusive::auto_unlink>>>,
|
||||
boost::intrusive::constant_time_size<false>> items_by_time;
|
||||
IntrusiveList<InputCacheItem> items_by_time;
|
||||
|
||||
using UriMap =
|
||||
boost::intrusive::set<InputCacheItem,
|
||||
|
Loading…
Reference in New Issue
Block a user