summaryrefslogtreecommitdiff
path: root/src/client/Client.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-06-10 18:57:30 +0200
committerMax Kellermann <max@duempel.org>2014-06-11 09:27:17 +0200
commit3364c1b8939aaf2f758a9396d0b73298042516d9 (patch)
tree046eb528b1e79d8c4bcd55e9939d58bde9981c21 /src/client/Client.hxx
parent0801b3f495aac982bc7d009d7ae81d8e3041db0c (diff)
ClientList: use class boost::intrusive::list
Eliminate extra allocations for the std::list node instances.
Diffstat (limited to 'src/client/Client.hxx')
-rw-r--r--src/client/Client.hxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/client/Client.hxx b/src/client/Client.hxx
index 56cd947ff..849a11ed4 100644
--- a/src/client/Client.hxx
+++ b/src/client/Client.hxx
@@ -27,6 +27,8 @@
#include "event/TimeoutMonitor.hxx"
#include "Compiler.h"
+#include <boost/intrusive/list.hpp>
+
#include <set>
#include <string>
#include <list>
@@ -41,12 +43,20 @@ struct Partition;
class Database;
class Storage;
-class Client final : private FullyBufferedSocket, TimeoutMonitor {
+class Client final
+ : FullyBufferedSocket, TimeoutMonitor,
+ public boost::intrusive::list_base_hook<boost::intrusive::link_mode<boost::intrusive::normal_link>> {
public:
Partition &partition;
struct playlist &playlist;
struct PlayerControl &player_control;
+ struct Disposer {
+ void operator()(Client *client) const {
+ delete client;
+ }
+ };
+
unsigned permission;
/** the uid of the client process, or -1 if unknown */