Public Types | Public Member Functions | Private Attributes | List of all members
ordered_map< Key, T, IgnoredLess, Allocator > Struct Template Reference

a minimal map-like container that preserves insertion order More...

#include <json.hpp>

Public Types

using const_iterator = typename Container::const_iterator
 
using Container = std::vector< std::pair< const Key, T >, Allocator >
 
using iterator = typename Container::iterator
 
using key_compare = std::equal_to< Key >
 
using key_type = Key
 
using mapped_type = T
 
template<typename InputIt >
using require_input_iter = typename std::enable_if< std::is_convertible< typename std::iterator_traits< InputIt >::iterator_category, std::input_iterator_tag >::value >::type
 
using size_type = typename Container::size_type
 
using value_type = typename Container::value_type
 

Public Member Functions

T & at (const key_type &key)
 
const T & at (const key_type &key) const
 
template<class KeyType , detail::enable_if_t< detail::is_usable_as_key_type< key_compare, key_type, KeyType >::value, int > = 0>
T & at (KeyType &&key)
 
template<class KeyType , detail::enable_if_t< detail::is_usable_as_key_type< key_compare, key_type, KeyType >::value, int > = 0>
const T & at (KeyType &&key) const
 
size_type count (const key_type &key) const
 
template<class KeyType , detail::enable_if_t< detail::is_usable_as_key_type< key_compare, key_type, KeyType >::value, int > = 0>
size_type count (KeyType &&key) const
 
std::pair< iterator, bool > emplace (const key_type &key, T &&t)
 
template<class KeyType , detail::enable_if_t< detail::is_usable_as_key_type< key_compare, key_type, KeyType >::value, int > = 0>
std::pair< iterator, bool > emplace (KeyType &&key, T &&t)
 
size_type erase (const key_type &key)
 
iterator erase (iterator first, iterator last)
 
iterator erase (iterator pos)
 
template<class KeyType , detail::enable_if_t< detail::is_usable_as_key_type< key_compare, key_type, KeyType >::value, int > = 0>
size_type erase (KeyType &&key)
 
iterator find (const key_type &key)
 
const_iterator find (const key_type &key) const
 
template<class KeyType , detail::enable_if_t< detail::is_usable_as_key_type< key_compare, key_type, KeyType >::value, int > = 0>
iterator find (KeyType &&key)
 
std::pair< iterator, bool > insert (const value_type &value)
 
template<typename InputIt , typename = require_input_iter<InputIt>>
void insert (InputIt first, InputIt last)
 
std::pair< iterator, bool > insert (value_type &&value)
 
T & operator[] (const key_type &key)
 
const T & operator[] (const key_type &key) const
 
template<class KeyType , detail::enable_if_t< detail::is_usable_as_key_type< key_compare, key_type, KeyType >::value, int > = 0>
T & operator[] (KeyType &&key)
 
template<class KeyType , detail::enable_if_t< detail::is_usable_as_key_type< key_compare, key_type, KeyType >::value, int > = 0>
const T & operator[] (KeyType &&key) const
 
 ordered_map () noexcept(noexcept(Container()))
 
 ordered_map (const Allocator &alloc) noexcept(noexcept(Container(alloc)))
 
template<class It >
 ordered_map (It first, It last, const Allocator &alloc=Allocator())
 
 ordered_map (std::initializer_list< value_type > init, const Allocator &alloc=Allocator())
 

Private Attributes

JSON_NO_UNIQUE_ADDRESS key_compare m_compare = key_compare()
 

Detailed Description

template<class Key, class T, class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
struct ordered_map< Key, T, IgnoredLess, Allocator >

a minimal map-like container that preserves insertion order

See also
https://json.nlohmann.me/api/ordered_map/

ordered_map: a minimal map-like container that preserves insertion order for use within nlohmann::basic_json<ordered_map>

Definition at line 3427 of file json.hpp.

Member Typedef Documentation

◆ const_iterator

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
using ordered_map< Key, T, IgnoredLess, Allocator >::const_iterator = typename Container::const_iterator

Definition at line 19039 of file json.hpp.

◆ Container

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
using ordered_map< Key, T, IgnoredLess, Allocator >::Container = std::vector<std::pair<const Key, T>, Allocator>

Definition at line 19037 of file json.hpp.

◆ iterator

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
using ordered_map< Key, T, IgnoredLess, Allocator >::iterator = typename Container::iterator

Definition at line 19038 of file json.hpp.

◆ key_compare

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
using ordered_map< Key, T, IgnoredLess, Allocator >::key_compare = std::equal_to<Key>

Definition at line 19045 of file json.hpp.

◆ key_type

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
using ordered_map< Key, T, IgnoredLess, Allocator >::key_type = Key

Definition at line 19035 of file json.hpp.

◆ mapped_type

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
using ordered_map< Key, T, IgnoredLess, Allocator >::mapped_type = T

Definition at line 19036 of file json.hpp.

◆ require_input_iter

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
template<typename InputIt >
using ordered_map< Key, T, IgnoredLess, Allocator >::require_input_iter = typename std::enable_if<std::is_convertible<typename std::iterator_traits<InputIt>::iterator_category, std::input_iterator_tag>::value>::type

Definition at line 19348 of file json.hpp.

◆ size_type

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
using ordered_map< Key, T, IgnoredLess, Allocator >::size_type = typename Container::size_type

Definition at line 19040 of file json.hpp.

◆ value_type

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
using ordered_map< Key, T, IgnoredLess, Allocator >::value_type = typename Container::value_type

Definition at line 19041 of file json.hpp.

Constructor & Destructor Documentation

◆ ordered_map() [1/4]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
ordered_map< Key, T, IgnoredLess, Allocator >::ordered_map ( )
inlinenoexcept

Definition at line 19050 of file json.hpp.

◆ ordered_map() [2/4]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
ordered_map< Key, T, IgnoredLess, Allocator >::ordered_map ( const Allocator &  alloc)
inlineexplicitnoexcept

Definition at line 19051 of file json.hpp.

◆ ordered_map() [3/4]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
template<class It >
ordered_map< Key, T, IgnoredLess, Allocator >::ordered_map ( It  first,
It  last,
const Allocator &  alloc = Allocator() 
)
inline

Definition at line 19053 of file json.hpp.

◆ ordered_map() [4/4]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
ordered_map< Key, T, IgnoredLess, Allocator >::ordered_map ( std::initializer_list< value_type init,
const Allocator &  alloc = Allocator() 
)
inline

Definition at line 19055 of file json.hpp.

Member Function Documentation

◆ at() [1/4]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
T& ordered_map< Key, T, IgnoredLess, Allocator >::at ( const key_type key)
inline

Definition at line 19110 of file json.hpp.

◆ at() [2/4]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
const T& ordered_map< Key, T, IgnoredLess, Allocator >::at ( const key_type key) const
inline

Definition at line 19138 of file json.hpp.

◆ at() [3/4]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
template<class KeyType , detail::enable_if_t< detail::is_usable_as_key_type< key_compare, key_type, KeyType >::value, int > = 0>
T& ordered_map< Key, T, IgnoredLess, Allocator >::at ( KeyType &&  key)
inline

Definition at line 19125 of file json.hpp.

◆ at() [4/4]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
template<class KeyType , detail::enable_if_t< detail::is_usable_as_key_type< key_compare, key_type, KeyType >::value, int > = 0>
const T& ordered_map< Key, T, IgnoredLess, Allocator >::at ( KeyType &&  key) const
inline

Definition at line 19153 of file json.hpp.

◆ count() [1/2]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
size_type ordered_map< Key, T, IgnoredLess, Allocator >::count ( const key_type key) const
inline

Definition at line 19264 of file json.hpp.

◆ count() [2/2]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
template<class KeyType , detail::enable_if_t< detail::is_usable_as_key_type< key_compare, key_type, KeyType >::value, int > = 0>
size_type ordered_map< Key, T, IgnoredLess, Allocator >::count ( KeyType &&  key) const
inline

Definition at line 19278 of file json.hpp.

◆ emplace() [1/2]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
std::pair<iterator, bool> ordered_map< Key, T, IgnoredLess, Allocator >::emplace ( const key_type key,
T &&  t 
)
inline

Definition at line 19058 of file json.hpp.

◆ emplace() [2/2]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
template<class KeyType , detail::enable_if_t< detail::is_usable_as_key_type< key_compare, key_type, KeyType >::value, int > = 0>
std::pair<iterator, bool> ordered_map< Key, T, IgnoredLess, Allocator >::emplace ( KeyType &&  key,
T &&  t 
)
inline

Definition at line 19073 of file json.hpp.

◆ erase() [1/4]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
size_type ordered_map< Key, T, IgnoredLess, Allocator >::erase ( const key_type key)
inline

Definition at line 19166 of file json.hpp.

◆ erase() [2/4]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
iterator ordered_map< Key, T, IgnoredLess, Allocator >::erase ( iterator  first,
iterator  last 
)
inline

Definition at line 19211 of file json.hpp.

◆ erase() [3/4]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
iterator ordered_map< Key, T, IgnoredLess, Allocator >::erase ( iterator  pos)
inline

Definition at line 19206 of file json.hpp.

◆ erase() [4/4]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
template<class KeyType , detail::enable_if_t< detail::is_usable_as_key_type< key_compare, key_type, KeyType >::value, int > = 0>
size_type ordered_map< Key, T, IgnoredLess, Allocator >::erase ( KeyType &&  key)
inline

Definition at line 19187 of file json.hpp.

◆ find() [1/3]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
iterator ordered_map< Key, T, IgnoredLess, Allocator >::find ( const key_type key)
inline

Definition at line 19290 of file json.hpp.

◆ find() [2/3]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
const_iterator ordered_map< Key, T, IgnoredLess, Allocator >::find ( const key_type key) const
inline

Definition at line 19316 of file json.hpp.

◆ find() [3/3]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
template<class KeyType , detail::enable_if_t< detail::is_usable_as_key_type< key_compare, key_type, KeyType >::value, int > = 0>
iterator ordered_map< Key, T, IgnoredLess, Allocator >::find ( KeyType &&  key)
inline

Definition at line 19304 of file json.hpp.

◆ insert() [1/3]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
std::pair<iterator, bool> ordered_map< Key, T, IgnoredLess, Allocator >::insert ( const value_type value)
inline

Definition at line 19333 of file json.hpp.

◆ insert() [2/3]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
template<typename InputIt , typename = require_input_iter<InputIt>>
void ordered_map< Key, T, IgnoredLess, Allocator >::insert ( InputIt  first,
InputIt  last 
)
inline

Definition at line 19351 of file json.hpp.

◆ insert() [3/3]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
std::pair<iterator, bool> ordered_map< Key, T, IgnoredLess, Allocator >::insert ( value_type &&  value)
inline

Definition at line 19328 of file json.hpp.

◆ operator[]() [1/4]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
T& ordered_map< Key, T, IgnoredLess, Allocator >::operator[] ( const key_type key)
inline

Definition at line 19086 of file json.hpp.

◆ operator[]() [2/4]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
const T& ordered_map< Key, T, IgnoredLess, Allocator >::operator[] ( const key_type key) const
inline

Definition at line 19098 of file json.hpp.

◆ operator[]() [3/4]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
template<class KeyType , detail::enable_if_t< detail::is_usable_as_key_type< key_compare, key_type, KeyType >::value, int > = 0>
T& ordered_map< Key, T, IgnoredLess, Allocator >::operator[] ( KeyType &&  key)
inline

Definition at line 19093 of file json.hpp.

◆ operator[]() [4/4]

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
template<class KeyType , detail::enable_if_t< detail::is_usable_as_key_type< key_compare, key_type, KeyType >::value, int > = 0>
const T& ordered_map< Key, T, IgnoredLess, Allocator >::operator[] ( KeyType &&  key) const
inline

Definition at line 19105 of file json.hpp.

Member Data Documentation

◆ m_compare

template<class Key , class T , class IgnoredLess = std::less<Key>, class Allocator = std::allocator<std::pair<const Key, T>>>
JSON_NO_UNIQUE_ADDRESS key_compare ordered_map< Key, T, IgnoredLess, Allocator >::m_compare = key_compare()
private

Definition at line 19360 of file json.hpp.


The documentation for this struct was generated from the following file:


behaviortree_cpp_v4
Author(s): Davide Faconti
autogenerated on Fri Dec 13 2024 03:19:18