All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Radiant::ArrayMap< Key, T, Allocator > Class Template Reference

Non-ordered map implementation that uses simple std::vector to store the elements. More...

#include <Radiant/ArrayMap.hpp>

Public Types

typedef Allocator allocator_type
 
typedef container::const_iterator const_iterator
 
typedef container::const_pointer const_pointer
 
typedef const value_type & const_reference
 
typedef
container::const_reverse_iterator 
const_reverse_iterator
 
typedef std::vector< std::pair
< Key, T >, Allocator > 
container
 
typedef container::difference_type difference_type
 
typedef container::iterator iterator
 
typedef Key key_type
 
typedef T mapped_type
 
typedef container::pointer pointer
 
typedef value_type & reference
 
typedef container::reverse_iterator reverse_iterator
 
typedef container::size_type size_type
 
typedef std::pair< Key, T > value_type
 

Public Member Functions

 ArrayMap (int reserve)
 
 ArrayMap (std::size_t reserve)
 
 ArrayMap (const ArrayMap &map)
 
 ArrayMap (ArrayMap &&map)
 
template<typename it >
 ArrayMap (it first, it last)
 
template<typename Y >
 ArrayMap (const Y &map)
 
iterator begin ()
 
const_iterator begin () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
void clear ()
 
bool contains (const Key &key) const
 
std::size_t count (const Key &key) const
 
const_reverse_iterator crbegin () const
 
const_reverse_iterator crend () const
 
bool empty () const
 
iterator end ()
 
const_iterator end () const
 
iterator erase (iterator it)
 
std::size_t erase (const Key &key)
 
iterator find (const Key &key)
 
const_iterator find (const Key &key) const
 
void insert (const value_type &value)
 
void insert (value_type &&value)
 
bool isEmpty () const
 
bool operator!= (const ArrayMap &map) const
 
ArrayMapoperator= (const ArrayMap &map)
 
ArrayMapoperator= (ArrayMap &&map)
 
template<typename Y >
void operator= (const Y &map)
 
bool operator== (const ArrayMap &map) const
 
T & operator[] (const Key &key)
 
T & operator[] (Key &&key)
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
std::size_t size () const
 
void swap (ArrayMap &other)
 
value (const Key &key) const
 

Detailed Description

template<typename Key, typename T, typename Allocator = typename std::vector<std::pair<Key, T>>::allocator_type>
class Radiant::ArrayMap< Key, T, Allocator >

Non-ordered map implementation that uses simple std::vector to store the elements.

This can be used instead of std::map when number is elements is small. Never use this class unless you have profiled that it actually makes a difference!

Notice that all non-const operations might invalidate all iterators.