GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::json::ObjectBase< Allocator > Class Template Reference

JSON object type whose API mimics that of std::map<String, Value>. More...

#include <GREM/core/formats/json.hpp>

Public Types

using key_type = StringBase<Allocator>
using mapped_type = ValueBase<Allocator>
using value_type = Pair<StringBase<Allocator>, ValueBase<Allocator>>
using size_type = typename ArrayList<value_type>::size_type
using difference_type = typename ArrayList<value_type>::difference_type
using allocator_type = Allocator<value_type>
using reference = typename ArrayList<value_type>::reference
using const_reference = typename ArrayList<value_type>::const_reference
using pointer = typename ArrayList<value_type>::pointer
using const_pointer = typename ArrayList<value_type>::const_pointer
using iterator = typename ArrayList<value_type>::iterator
using const_iterator = typename ArrayList<value_type>::const_iterator
using reverse_iterator = typename ArrayList<value_type>::reverse_iterator
using const_reverse_iterator = typename ArrayList<value_type>::const_reverse_iterator

Public Member Functions

 ObjectBase () noexcept
 ObjectBase (const allocator_type &allocator) noexcept
 ~ObjectBase ()
template<input_iterator InputIterator, sentinel_for< InputIterator > Sentinel>
 ObjectBase (InputIterator first, Sentinel last, const allocator_type &allocator=allocator_type())
 ObjectBase (std::initializer_list< value_type > ilist, const allocator_type &allocator=allocator_type())
 ObjectBase (const ObjectBase &other, const allocator_type &allocator)
 ObjectBase (const ObjectBase &other)
 ObjectBase (ObjectBase &&other, const allocator_type &allocator) noexcept
 ObjectBase (ObjectBase &&other) noexcept
ObjectBase & operator= (const ObjectBase &other)
ObjectBase & operator= (ObjectBase &&other) noexcept(std::allocator_traits< allocator_type >::propagate_on_container_move_assignment::value||//NOLINT(cppcoreguidelines-noexcept-move-operations, performance-noexcept-move-constructor) std::allocator_traits< allocator_type >::is_always_equal::value)
ObjectBase & operator= (std::initializer_list< value_type > ilist)
allocator_type get_allocator () const noexcept
mapped_type & at (StringView key)
const mapped_type & at (StringView key) const
mapped_type & operator[] (const key_type &k)
mapped_type & operator[] (key_type &&k)
iterator begin () noexcept
const_iterator begin () const noexcept
const_iterator cbegin () const noexcept
iterator end () noexcept
const_iterator end () const noexcept
const_iterator cend () const noexcept
reverse_iterator rbegin () noexcept
const_reverse_iterator rbegin () const noexcept
const_reverse_iterator crbegin () const noexcept
reverse_iterator rend () noexcept
const_reverse_iterator rend () const noexcept
const_reverse_iterator crend () const noexcept
bool empty () const noexcept
size_type size () const noexcept
size_type max_size () const noexcept
size_type capacity () const noexcept
void clear () noexcept
void reserve (size_type newCapacity)
template<typename P>
Pair< iterator, bool > insert (P &&value)
template<typename P>
requires (!convertible_to<P, const_iterator>)
iterator insert (const_iterator pos, P &&value)
template<input_iterator InputIterator, sentinel_for< InputIterator > Sentinel>
void insert (InputIterator first, Sentinel last)
void insert (std::initializer_list< value_type > ilist)
template<typename R>
void insert_range (R &&r)
template<typename... Args>
Pair< iterator, bool > emplace (Args &&... args)
template<typename... Args>
iterator emplace_hint (const_iterator hint, Args &&... args)
template<typename... Args>
Pair< iterator, bool > try_emplace (const key_type &k, Args &&... args)
template<typename... Args>
Pair< iterator, bool > try_emplace (key_type &&k, Args &&... args)
template<typename... Args>
iterator try_emplace (const_iterator, const key_type &k, Args &&... args)
template<typename... Args>
iterator try_emplace (const_iterator, key_type &&k, Args &&... args)
iterator erase (const_iterator pos)
size_type erase (StringView key)
void swap (ObjectBase &other) noexcept
size_type count (StringView key) const noexcept
bool contains (StringView key) const noexcept
iterator find (StringView key) noexcept
const_iterator find (StringView key) const noexcept
Pair< iterator, iterator > equal_range (StringView key) noexcept
Pair< const_iterator, const_iterator > equal_range (StringView key) const noexcept
iterator lower_bound (StringView key) noexcept
const_iterator lower_bound (StringView key) const noexcept
iterator upper_bound (StringView key) noexcept
const_iterator upper_bound (StringView key) const noexcept
bool operator== (const ObjectBase &other) const noexcept
std::partial_ordering operator<=> (const ObjectBase &other) const noexcept
template<typename P>
Pair< typename ObjectBase< Allocator >::iterator, bool > insert (P &&value)
template<typename... Args>
Pair< typename ObjectBase< Allocator >::iterator, bool > emplace (Args &&... args)
template<typename... Args>
Pair< typename ObjectBase< Allocator >::iterator, bool > try_emplace (const key_type &k, Args &&... args)
template<typename... Args>
Pair< typename ObjectBase< Allocator >::iterator, bool > try_emplace (key_type &&k, Args &&... args)

Friends

template<typename Predicate>
size_type erase_if (ObjectBase &container, Predicate predicate)

Detailed Description

template<template< typename > typename Allocator>
class grem::json::ObjectBase< Allocator >

JSON object type whose API mimics that of std::map<String, Value>.

Template Parameters
Allocatorallocator type template to use.

Member Typedef Documentation

◆ key_type

template<template< typename > typename Allocator>
using grem::json::ObjectBase< Allocator >::key_type = StringBase<Allocator>

◆ mapped_type

template<template< typename > typename Allocator>
using grem::json::ObjectBase< Allocator >::mapped_type = ValueBase<Allocator>

◆ value_type

template<template< typename > typename Allocator>
using grem::json::ObjectBase< Allocator >::value_type = Pair<StringBase<Allocator>, ValueBase<Allocator>>

◆ size_type

template<template< typename > typename Allocator>
using grem::json::ObjectBase< Allocator >::size_type = typename ArrayList<value_type>::size_type

◆ difference_type

template<template< typename > typename Allocator>
using grem::json::ObjectBase< Allocator >::difference_type = typename ArrayList<value_type>::difference_type

◆ allocator_type

template<template< typename > typename Allocator>
using grem::json::ObjectBase< Allocator >::allocator_type = Allocator<value_type>

◆ reference

template<template< typename > typename Allocator>
using grem::json::ObjectBase< Allocator >::reference = typename ArrayList<value_type>::reference

◆ const_reference

template<template< typename > typename Allocator>
using grem::json::ObjectBase< Allocator >::const_reference = typename ArrayList<value_type>::const_reference

◆ pointer

template<template< typename > typename Allocator>
using grem::json::ObjectBase< Allocator >::pointer = typename ArrayList<value_type>::pointer

◆ const_pointer

template<template< typename > typename Allocator>
using grem::json::ObjectBase< Allocator >::const_pointer = typename ArrayList<value_type>::const_pointer

◆ iterator

template<template< typename > typename Allocator>
using grem::json::ObjectBase< Allocator >::iterator = typename ArrayList<value_type>::iterator

◆ const_iterator

template<template< typename > typename Allocator>
using grem::json::ObjectBase< Allocator >::const_iterator = typename ArrayList<value_type>::const_iterator

◆ reverse_iterator

template<template< typename > typename Allocator>
using grem::json::ObjectBase< Allocator >::reverse_iterator = typename ArrayList<value_type>::reverse_iterator

◆ const_reverse_iterator

template<template< typename > typename Allocator>
using grem::json::ObjectBase< Allocator >::const_reverse_iterator = typename ArrayList<value_type>::const_reverse_iterator

Constructor & Destructor Documentation

◆ ObjectBase() [1/8]

template<template< typename > typename Allocator>
grem::json::ObjectBase< Allocator >::ObjectBase ( )
inlinenoexcept

◆ ObjectBase() [2/8]

template<template< typename > typename Allocator>
grem::json::ObjectBase< Allocator >::ObjectBase ( const allocator_type & allocator)
inlineexplicitnoexcept

◆ ~ObjectBase()

template<template< typename > typename Allocator>
grem::json::ObjectBase< Allocator >::~ObjectBase ( )
inlinedefault

◆ ObjectBase() [3/8]

template<template< typename > typename Allocator>
template<input_iterator InputIterator, sentinel_for< InputIterator > Sentinel>
grem::json::ObjectBase< Allocator >::ObjectBase ( InputIterator first,
Sentinel last,
const allocator_type & allocator = allocator_type() )
inline

◆ ObjectBase() [4/8]

template<template< typename > typename Allocator>
grem::json::ObjectBase< Allocator >::ObjectBase ( std::initializer_list< value_type > ilist,
const allocator_type & allocator = allocator_type() )
inline

◆ ObjectBase() [5/8]

template<template< typename > typename Allocator>
grem::json::ObjectBase< Allocator >::ObjectBase ( const ObjectBase< Allocator > & other,
const allocator_type & allocator )
inline

◆ ObjectBase() [6/8]

template<template< typename > typename Allocator>
grem::json::ObjectBase< Allocator >::ObjectBase ( const ObjectBase< Allocator > & other)
inline

◆ ObjectBase() [7/8]

template<template< typename > typename Allocator>
grem::json::ObjectBase< Allocator >::ObjectBase ( ObjectBase< Allocator > && other,
const allocator_type & allocator )
inlinenoexcept

◆ ObjectBase() [8/8]

template<template< typename > typename Allocator>
grem::json::ObjectBase< Allocator >::ObjectBase ( ObjectBase< Allocator > && other)
inlinenoexcept

Member Function Documentation

◆ operator=() [1/3]

template<template< typename > typename Allocator>
ObjectBase< Allocator > & grem::json::ObjectBase< Allocator >::operator= ( const ObjectBase< Allocator > & other)
inlinedefault

◆ operator=() [2/3]

template<template< typename > typename Allocator>
ObjectBase< Allocator > & grem::json::ObjectBase< Allocator >::operator= ( ObjectBase< Allocator > && other) const
inlinedefaultnoexcept

◆ operator=() [3/3]

template<template< typename > typename Allocator>
ObjectBase< Allocator > & grem::json::ObjectBase< Allocator >::operator= ( std::initializer_list< value_type > ilist)
inline

◆ get_allocator()

template<template< typename > typename Allocator>
ObjectBase< Allocator >::allocator_type grem::json::ObjectBase< Allocator >::get_allocator ( ) const
inlinenodiscardnoexcept

◆ at() [1/2]

template<template< typename > typename Allocator>
ObjectBase< Allocator >::mapped_type & grem::json::ObjectBase< Allocator >::at ( StringView key)
inlinenodiscard

◆ at() [2/2]

template<template< typename > typename Allocator>
const ObjectBase< Allocator >::mapped_type & grem::json::ObjectBase< Allocator >::at ( StringView key) const
inlinenodiscard

◆ operator[]() [1/2]

template<template< typename > typename Allocator>
ObjectBase< Allocator >::mapped_type & grem::json::ObjectBase< Allocator >::operator[] ( const key_type & k)
inlinenodiscard

◆ operator[]() [2/2]

template<template< typename > typename Allocator>
ObjectBase< Allocator >::mapped_type & grem::json::ObjectBase< Allocator >::operator[] ( key_type && k)
inlinenodiscard

◆ begin() [1/2]

template<template< typename > typename Allocator>
ObjectBase< Allocator >::iterator grem::json::ObjectBase< Allocator >::begin ( )
inlinenodiscardnoexcept

◆ begin() [2/2]

template<template< typename > typename Allocator>
ObjectBase< Allocator >::const_iterator grem::json::ObjectBase< Allocator >::begin ( ) const
inlinenodiscardnoexcept

◆ cbegin()

template<template< typename > typename Allocator>
ObjectBase< Allocator >::const_iterator grem::json::ObjectBase< Allocator >::cbegin ( ) const
inlinenodiscardnoexcept

◆ end() [1/2]

template<template< typename > typename Allocator>
ObjectBase< Allocator >::iterator grem::json::ObjectBase< Allocator >::end ( )
inlinenodiscardnoexcept

◆ end() [2/2]

template<template< typename > typename Allocator>
ObjectBase< Allocator >::const_iterator grem::json::ObjectBase< Allocator >::end ( ) const
inlinenodiscardnoexcept

◆ cend()

template<template< typename > typename Allocator>
ObjectBase< Allocator >::const_iterator grem::json::ObjectBase< Allocator >::cend ( ) const
inlinenodiscardnoexcept

◆ rbegin() [1/2]

template<template< typename > typename Allocator>
ObjectBase< Allocator >::reverse_iterator grem::json::ObjectBase< Allocator >::rbegin ( )
inlinenodiscardnoexcept

◆ rbegin() [2/2]

template<template< typename > typename Allocator>
ObjectBase< Allocator >::const_reverse_iterator grem::json::ObjectBase< Allocator >::rbegin ( ) const
inlinenodiscardnoexcept

◆ crbegin()

template<template< typename > typename Allocator>
ObjectBase< Allocator >::const_reverse_iterator grem::json::ObjectBase< Allocator >::crbegin ( ) const
inlinenodiscardnoexcept

◆ rend() [1/2]

template<template< typename > typename Allocator>
ObjectBase< Allocator >::reverse_iterator grem::json::ObjectBase< Allocator >::rend ( )
inlinenodiscardnoexcept

◆ rend() [2/2]

template<template< typename > typename Allocator>
ObjectBase< Allocator >::const_reverse_iterator grem::json::ObjectBase< Allocator >::rend ( ) const
inlinenodiscardnoexcept

◆ crend()

template<template< typename > typename Allocator>
ObjectBase< Allocator >::const_reverse_iterator grem::json::ObjectBase< Allocator >::crend ( ) const
inlinenodiscardnoexcept

◆ empty()

template<template< typename > typename Allocator>
bool grem::json::ObjectBase< Allocator >::empty ( ) const
inlinenodiscardnoexcept

◆ size()

template<template< typename > typename Allocator>
ObjectBase< Allocator >::size_type grem::json::ObjectBase< Allocator >::size ( ) const
inlinenodiscardnoexcept

◆ max_size()

template<template< typename > typename Allocator>
ObjectBase< Allocator >::size_type grem::json::ObjectBase< Allocator >::max_size ( ) const
inlinenodiscardnoexcept

◆ capacity()

template<template< typename > typename Allocator>
ObjectBase< Allocator >::size_type grem::json::ObjectBase< Allocator >::capacity ( ) const
inlinenodiscardnoexcept

◆ clear()

template<template< typename > typename Allocator>
void grem::json::ObjectBase< Allocator >::clear ( )
inlinenoexcept

◆ reserve()

template<template< typename > typename Allocator>
void grem::json::ObjectBase< Allocator >::reserve ( size_type newCapacity)
inline

◆ insert() [1/5]

template<template< typename > typename Allocator>
template<typename P>
Pair< iterator, bool > grem::json::ObjectBase< Allocator >::insert ( P && value)

◆ insert() [2/5]

template<template< typename > typename Allocator>
requires (!convertible_to<P, const_iterator>)
template<typename P>
requires (!convertible_to<P, const_iterator>)
ObjectBase< Allocator >::iterator grem::json::ObjectBase< Allocator >::insert ( const_iterator pos,
P && value )
inline

◆ insert() [3/5]

template<template< typename > typename Allocator>
template<input_iterator InputIterator, sentinel_for< InputIterator > Sentinel>
void grem::json::ObjectBase< Allocator >::insert ( InputIterator first,
Sentinel last )
inline

◆ insert() [4/5]

template<template< typename > typename Allocator>
void grem::json::ObjectBase< Allocator >::insert ( std::initializer_list< value_type > ilist)
inline

◆ insert_range()

template<template< typename > typename Allocator>
template<typename R>
void grem::json::ObjectBase< Allocator >::insert_range ( R && r)
inline

◆ emplace() [1/2]

template<template< typename > typename Allocator>
template<typename... Args>
Pair< iterator, bool > grem::json::ObjectBase< Allocator >::emplace ( Args &&... args)

◆ emplace_hint()

template<template< typename > typename Allocator>
template<typename... Args>
ObjectBase< Allocator >::iterator grem::json::ObjectBase< Allocator >::emplace_hint ( const_iterator hint,
Args &&... args )
inline

◆ try_emplace() [1/6]

template<template< typename > typename Allocator>
template<typename... Args>
Pair< iterator, bool > grem::json::ObjectBase< Allocator >::try_emplace ( const key_type & k,
Args &&... args )

◆ try_emplace() [2/6]

template<template< typename > typename Allocator>
template<typename... Args>
Pair< iterator, bool > grem::json::ObjectBase< Allocator >::try_emplace ( key_type && k,
Args &&... args )

◆ try_emplace() [3/6]

template<template< typename > typename Allocator>
template<typename... Args>
ObjectBase< Allocator >::iterator grem::json::ObjectBase< Allocator >::try_emplace ( const_iterator ,
const key_type & k,
Args &&... args )
inline

◆ try_emplace() [4/6]

template<template< typename > typename Allocator>
template<typename... Args>
ObjectBase< Allocator >::iterator grem::json::ObjectBase< Allocator >::try_emplace ( const_iterator ,
key_type && k,
Args &&... args )
inline

◆ erase() [1/2]

template<template< typename > typename Allocator>
ObjectBase< Allocator >::iterator grem::json::ObjectBase< Allocator >::erase ( const_iterator pos)
inline

◆ erase() [2/2]

template<template< typename > typename Allocator>
ObjectBase< Allocator >::size_type grem::json::ObjectBase< Allocator >::erase ( StringView key)
inline

◆ swap()

template<template< typename > typename Allocator>
void grem::json::ObjectBase< Allocator >::swap ( ObjectBase< Allocator > & other)
inlinenoexcept

◆ count()

template<template< typename > typename Allocator>
ObjectBase< Allocator >::size_type grem::json::ObjectBase< Allocator >::count ( StringView key) const
inlinenodiscardnoexcept

◆ contains()

template<template< typename > typename Allocator>
bool grem::json::ObjectBase< Allocator >::contains ( StringView key) const
inlinenodiscardnoexcept

◆ find() [1/2]

template<template< typename > typename Allocator>
ObjectBase< Allocator >::iterator grem::json::ObjectBase< Allocator >::find ( StringView key)
inlinenodiscardnoexcept

◆ find() [2/2]

template<template< typename > typename Allocator>
ObjectBase< Allocator >::const_iterator grem::json::ObjectBase< Allocator >::find ( StringView key) const
inlinenodiscardnoexcept

◆ equal_range() [1/2]

template<template< typename > typename Allocator>
Pair< typename ObjectBase< Allocator >::iterator, typename ObjectBase< Allocator >::iterator > grem::json::ObjectBase< Allocator >::equal_range ( StringView key)
inlinenodiscardnoexcept

◆ equal_range() [2/2]

template<template< typename > typename Allocator>
Pair< typename ObjectBase< Allocator >::const_iterator, typename ObjectBase< Allocator >::const_iterator > grem::json::ObjectBase< Allocator >::equal_range ( StringView key) const
inlinenodiscardnoexcept

◆ lower_bound() [1/2]

template<template< typename > typename Allocator>
ObjectBase< Allocator >::iterator grem::json::ObjectBase< Allocator >::lower_bound ( StringView key)
inlinenodiscardnoexcept

◆ lower_bound() [2/2]

template<template< typename > typename Allocator>
ObjectBase< Allocator >::const_iterator grem::json::ObjectBase< Allocator >::lower_bound ( StringView key) const
inlinenodiscardnoexcept

◆ upper_bound() [1/2]

template<template< typename > typename Allocator>
ObjectBase< Allocator >::iterator grem::json::ObjectBase< Allocator >::upper_bound ( StringView key)
inlinenodiscardnoexcept

◆ upper_bound() [2/2]

template<template< typename > typename Allocator>
ObjectBase< Allocator >::const_iterator grem::json::ObjectBase< Allocator >::upper_bound ( StringView key) const
inlinenodiscardnoexcept

◆ operator==()

template<template< typename > typename Allocator>
bool grem::json::ObjectBase< Allocator >::operator== ( const ObjectBase< Allocator > & other) const
inlinenodiscardnoexcept

◆ operator<=>()

template<template< typename > typename Allocator>
std::partial_ordering grem::json::ObjectBase< Allocator >::operator<=> ( const ObjectBase< Allocator > & other) const
inlinenodiscardnoexcept

◆ insert() [5/5]

template<template< typename > typename Allocator>
template<typename P>
Pair< typename ObjectBase< Allocator >::iterator, bool > grem::json::ObjectBase< Allocator >::insert ( P && value)
inline

◆ emplace() [2/2]

template<template< typename > typename Allocator>
template<typename... Args>
Pair< typename ObjectBase< Allocator >::iterator, bool > grem::json::ObjectBase< Allocator >::emplace ( Args &&... args)
inline

◆ try_emplace() [5/6]

template<template< typename > typename Allocator>
template<typename... Args>
Pair< typename ObjectBase< Allocator >::iterator, bool > grem::json::ObjectBase< Allocator >::try_emplace ( const key_type & k,
Args &&... args )
inline

◆ try_emplace() [6/6]

template<template< typename > typename Allocator>
template<typename... Args>
Pair< typename ObjectBase< Allocator >::iterator, bool > grem::json::ObjectBase< Allocator >::try_emplace ( key_type && k,
Args &&... args )
inline

◆ erase_if

template<template< typename > typename Allocator>
template<typename Predicate>
size_type erase_if ( ObjectBase< Allocator > & container,
Predicate predicate )
friend

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