Class fixed_multimap

Synopsis

#include <include/EASTL/fixed_map.h>

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

Description

fixed_multimap

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


Key                    The key object (key in the key/value pair).
T                      The mapped object (value in the key/value pair).
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: multimap

Methods

fixed_multimap overloadfixed_multimap
get_overflow_allocator overload
insertThis is an extension to the C++ standard
max_size
operator= overload
reset_lose_memory
set_overflow_allocator
swap

Source

Lines 131-180 in include/EASTL/fixed_map.h.

template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow = true, typename Compare = eastl::less<Key>, typename OverflowAllocator = EASTLAllocatorType>
class fixed_multimap : public multimap<Key, T, Compare, fixed_node_allocator<sizeof(typename multimap<Key, T>::node_type), 
                                       nodeCount, EASTL_ALIGN_OF(eastl::pair<Key, T>), 0, bEnableOverflow, OverflowAllocator> >
{
public:
    typedef fixed_node_allocator<sizeof(typename multimap<Key, T>::node_type), nodeCount, 
                EASTL_ALIGN_OF(eastl::pair<Key, T>), 0, bEnableOverflow, OverflowAllocator>                                      fixed_allocator_type;
    typedef typename fixed_allocator_type::overflow_allocator_type                                                               overflow_allocator_type;
    typedef multimap<Key, T, Compare, fixed_allocator_type>                                                                      base_type;
    typedef fixed_multimap<Key, T, 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;
    using base_type::get_compare;
public:
    fixed_multimap();
    fixed_multimap(const overflow_allocator_type& overflowAllocator);
    explicit fixed_multimap(const Compare& compare);
    fixed_multimap(const this_type& x);
    fixed_multimap(this_type&& x);
    fixed_multimap(this_type&& x, const overflow_allocator_type& overflowAllocator);
    fixed_multimap(std::initializer_list<value_type> ilist, const overflow_allocator_type& overflowAllocator = EASTL_FIXED_MULTIMAP_DEFAULT_ALLOCATOR);
    template <typename InputIterator>
    fixed_multimap(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_multimap





Add Discussion as Guest

Log in