#pragma once #include "data_structures/concurrent/skiplist.hpp" template class ConcurrentMultiSet { typedef SkipList list; typedef typename SkipList::Iterator list_it; typedef typename SkipList::ConstIterator list_it_con; public: ConcurrentMultiSet() {} class Accessor : public AccessorBase { friend class ConcurrentMultiSet; using AccessorBase::AccessorBase; private: using AccessorBase::accessor; public: list_it insert(const T &item) { return accessor.insert_non_unique(item); } list_it insert(T &&item) { return accessor.insert_non_unique(std::forward(item)); } list_it_con find(const T &item) const { return accessor.find(item); } list_it find(const T &item) { return accessor.find(item); } list_it_con find_or_larger(const T &item) const { return accessor.find_or_larger(item); } list_it find_or_larger(const T &item) { return accessor.find_or_larger(item); } bool contains(const T &item) const { return this->find(item) != this->end(); } bool remove(const T &item) { return accessor.remove(item); } }; Accessor access() { return Accessor(&skiplist); } const Accessor access() const { return Accessor(&skiplist); } private: list skiplist; };