Class fixed_multiset

Synopsis

#include <include/EASTL/fixed_set.h>

template <typename Key, size_t nodeCount, bool bEnableOverflow = true, typename Compare = eastl::less<Key>, typename OverflowAllocator = EASTLAllocatorType>
class fixed_multiset : public multiset<Key, Compare, fixed_node_allocator<sizeof(typename multiset<Key>::node_type), 
									   nodeCount, EASTL_ALIGN_OF(Key), 0, bEnableOverflow, OverflowAllocator> >

Description

fixed_multiset

Implements a multiset with a fixed block of memory identified by the nodeCount template parameter.


Key                    The type of object the set holds (a.k.a. value).
nodeCount              The max number of objects to contain.
bEnableOverflow        Whether or not we should use the global heap if our object pool is exhausted.
Compare                Compare function/object for set ordering.
OverflowAllocator              Overflow allocator, which is only used if bEnableOverflow == true. Defaults to the global heap.

Mentioned in

Inheritance

Ancestors: multiset

Methods

fixed_multiset overloadfixed_multiset
get_overflow_allocator overload
max_size
operator= overload
reset_lose_memory
set_overflow_allocator
swap

Source

Lines 133-181 in include/EASTL/fixed_set.h.

template <typename Key, size_t nodeCount, bool bEnableOverflow = true, typename Compare = eastl::less<Key>, typename OverflowAllocator = EASTLAllocatorType>
class fixed_multiset : public multiset<Key, Compare, fixed_node_allocator<sizeof(typename multiset<Key>::node_type), 
                                       nodeCount, EASTL_ALIGN_OF(Key), 0, bEnableOverflow, OverflowAllocator> >
{
public:
    typedef fixed_node_allocator<sizeof(typename multiset<Key>::node_type), nodeCount, 
                 EASTL_ALIGN_OF(Key), 0, bEnableOverflow, OverflowAllocator>                fixed_allocator_type;
    typedef typename fixed_allocator_type::overflow_allocator_type                          overflow_allocator_type;
    typedef multiset<Key, Compare, fixed_allocator_type>                                    base_type;
    typedef fixed_multiset<Key, nodeCount, bEnableOverflow, Compare, OverflowAllocator>     this_type;
    typedef typename base_type::value_type                                                  value_type;
    typedef typename base_type::node_type                                                   node_type;
    typedef typename base_type::size_type                                                   size_type;
    enum { kMaxSize = nodeCount };
    using base_type::insert;
protected:
    char mBuffer[fixed_allocator_type::kBufferSize]; // kBufferSize will take into account alignment requirements.
    using base_type::mAllocator;
public:
    fixed_multiset();
    fixed_multiset(const overflow_allocator_type& overflowAllocator);
    explicit fixed_multiset(const Compare& compare);
    fixed_multiset(const this_type& x);
    fixed_multiset(this_type&& x);
    fixed_multiset(this_type&& x, const overflow_allocator_type& overflowAllocator);
    fixed_multiset(std::initializer_list<value_type> ilist, const overflow_allocator_type& overflowAllocator = EASTL_FIXED_MULTISET_DEFAULT_ALLOCATOR);
    template <typename InputIterator>
    fixed_multiset(InputIterator first, InputIterator last);
    this_type& operator=(const this_type& x);
    this_type& operator=(std::initializer_list<value_type> ilist);
    this_type& operator=(this_type&& x);
    void swap(this_type& x);
    void reset_lose_memory(); // This is a unilateral reset to an initially empty state. No destructors are called, no deallocation occurs.
    size_type max_size() const;
    const overflow_allocator_type& get_overflow_allocator() const EA_NOEXCEPT;
    overflow_allocator_type&       get_overflow_allocator() EA_NOEXCEPT;
    void                           set_overflow_allocator(const overflow_allocator_type& allocator);
}; // fixed_multiset





Add Discussion as Guest

Log in