ClientList: use class boost::intrusive::list

Eliminate extra allocations for the std::list node instances.
This commit is contained in:
Max Kellermann
2014-06-10 18:57:30 +02:00
parent 0801b3f495
commit 3364c1b893
4 changed files with 25 additions and 29 deletions

View File

@@ -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 */