diff --git a/src/Partition.hxx b/src/Partition.hxx index 7c0690e9c..7a79f0e0d 100644 --- a/src/Partition.hxx +++ b/src/Partition.hxx @@ -29,14 +29,13 @@ #include "player/Control.hxx" #include "player/Listener.hxx" #include "protocol/RangeArg.hxx" +#include "util/IntrusiveList.hxx" #include "ReplayGainMode.hxx" #include "SingleMode.hxx" #include "ConsumeMode.hxx" #include "Chrono.hxx" #include "config.h" -#include - #include #include @@ -47,6 +46,7 @@ class MultipleOutputs; class SongLoader; class ClientListener; class Client; +struct ClientPerPartitionListHook; /** * A partition of the Music Player Daemon. It is a separate unit with @@ -65,10 +65,7 @@ struct Partition final : QueueListener, PlayerListener, MixerListener { std::unique_ptr listener; - boost::intrusive::list, - boost::intrusive::link_mode>>, - boost::intrusive::constant_time_size> clients; + IntrusiveList clients; /** * Monitor for idle events local to this partition. diff --git a/src/client/Client.hxx b/src/client/Client.hxx index 874d2035b..0ff71ae7f 100644 --- a/src/client/Client.hxx +++ b/src/client/Client.hxx @@ -27,9 +27,7 @@ #include "tag/Mask.hxx" #include "event/FullyBufferedSocket.hxx" #include "event/CoarseTimerEvent.hxx" - -#include -#include +#include "util/IntrusiveList.hxx" #include #include @@ -50,10 +48,13 @@ class Storage; class BackgroundCommand; class Client final - : FullyBufferedSocket, - public boost::intrusive::list_base_hook, - boost::intrusive::link_mode>, - public boost::intrusive::list_base_hook> { + : FullyBufferedSocket +{ + friend struct ClientPerPartitionListHook; + friend class ClientList; + + IntrusiveListHook list_siblings, partition_siblings; + CoarseTimerEvent timeout_event; Partition *partition; @@ -295,6 +296,9 @@ private: void OnTimeout() noexcept; }; +struct ClientPerPartitionListHook + : IntrusiveListMemberHookTraits<&Client::partition_siblings> {}; + void client_new(EventLoop &loop, Partition &partition, UniqueSocketDescriptor fd, SocketAddress address, int uid, diff --git a/src/client/List.hxx b/src/client/List.hxx index a891ae809..89af8f920 100644 --- a/src/client/List.hxx +++ b/src/client/List.hxx @@ -21,13 +21,11 @@ #define MPD_CLIENT_LIST_HXX #include "Client.hxx" - -#include +#include "util/IntrusiveList.hxx" class ClientList { using List = - boost::intrusive::list>; + IntrusiveList, true>; const unsigned max_size;