Kagome
Polkadot Runtime Engine in C++17
kagome::common::SizeLimitedContainer< BaseContainer, MaxSize > Class Template Reference

#include <size_limited_containers.hpp>

Inheritance diagram for kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >:
Collaboration diagram for kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >:

Public Member Functions

constexpr Base::size_type max_size ()
 
 SizeLimitedContainer ()=default
 
 SizeLimitedContainer (size_t size)
 
 SizeLimitedContainer (size_t size, const typename Base::value_type &value)
 
 SizeLimitedContainer (const Base &other)
 
 SizeLimitedContainer (Base &&other)
 
template<typename Iter , typename = std::enable_if_t<std::is_base_of_v< std::input_iterator_tag, typename std::iterator_traits<Iter>::iterator_category>>>
 SizeLimitedContainer (Iter begin, Iter end)
 
 SizeLimitedContainer (std::initializer_list< typename Base::value_type > list)
 
SizeLimitedContaineroperator= (const Base &other)
 
SizeLimitedContaineroperator= (Base &&other)
 
SizeLimitedContaineroperator= (std::initializer_list< typename Base::value_type > list)
 
void assign (typename Base::size_type size, const typename Base::value_type &value)
 
template<typename Iter , typename = std::enable_if_t<std::is_base_of_v< std::input_iterator_tag, typename std::iterator_traits<Iter>::iterator_category>>>
void assign (Iter begin, Iter end)
 
void assign (std::initializer_list< typename Base::value_type > list)
 
template<typename... Args>
Base::reference & emplace_back (Args &&...args)
 
template<typename Iter , typename... Args, bool isIter = std::is_same_v<Iter, typename Base::iterator>, bool isConstIter = std::is_same_v<Iter, typename Base::const_iterator>, typename = std::enable_if_t<isIter or isConstIter>>
Base::iterator emplace (Iter pos, Args &&...args)
 
template<typename Iter , bool isIter = std::is_same_v<Iter, typename Base::iterator>, bool isConstIter = std::is_same_v<Iter, typename Base::const_iterator>, typename = std::enable_if_t<isIter or isConstIter>>
Base::iterator insert (Iter pos, const typename Base::value_type &value)
 
template<typename Iter , bool isIter = std::is_same_v<Iter, typename Base::iterator>, bool isConstIter = std::is_same_v<Iter, typename Base::const_iterator>, typename = std::enable_if_t<isIter or isConstIter>>
Base::iterator insert (Iter pos, typename Base::size_type size, const typename Base::value_type &value)
 
template<typename OutIt , typename InIt , bool isIter = std::is_same_v<OutIt, typename Base::iterator>, bool isConstIter = std::is_same_v<OutIt, typename Base::const_iterator>, typename = std::enable_if_t<isIter or isConstIter>, typename = std::enable_if_t<std::is_base_of_v< std::input_iterator_tag, typename std::iterator_traits<InIt>::iterator_category>>>
Base::iterator insert (OutIt pos, InIt begin, InIt end)
 
template<typename Iter , bool isIter = std::is_same_v<Iter, typename Base::iterator>, bool isConstIter = std::is_same_v<Iter, typename Base::const_iterator>, typename = std::enable_if_t<isIter or isConstIter>>
Base::iterator insert (Iter pos, std::initializer_list< typename Base::value_type > &&list)
 
template<typename V >
void push_back (V &&value)
 
void reserve (typename Base::size_type size)
 
void resize (typename Base::size_type size)
 
void resize (typename Base::size_type size, const typename Base::value_type &value)
 
bool operator== (const Base &other) const noexcept
 
bool operator== (const Span &other) const noexcept
 
bool operator!= (const Base &other) const noexcept
 
bool operator!= (const Span &other) const noexcept
 
bool operator< (const Base &other) const noexcept
 
bool operator< (const Span &other) const noexcept
 

Static Public Attributes

static constexpr bool is_static_collection = false
 

Protected Types

using Base = BaseContainer
 
using Span = gsl::span< typename Base::value_type >
 

Static Protected Attributes

static constexpr bool size_check_is_enabled
 

Detailed Description

template<typename BaseContainer, std::size_t MaxSize>
class kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >

Definition at line 35 of file size_limited_containers.hpp.

Member Typedef Documentation

template<typename BaseContainer, std::size_t MaxSize>
using kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::Base = BaseContainer
protected

Definition at line 37 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
using kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::Span = gsl::span<typename Base::value_type>
protected

Definition at line 38 of file size_limited_containers.hpp.

Constructor & Destructor Documentation

template<typename BaseContainer, std::size_t MaxSize>
kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::SizeLimitedContainer ( )
default
template<typename BaseContainer, std::size_t MaxSize>
kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::SizeLimitedContainer ( size_t  size)
inline

Definition at line 53 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::SizeLimitedContainer ( size_t  size,
const typename Base::value_type &  value 
)
inline

Definition at line 66 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::SizeLimitedContainer ( const Base other)
inline

Definition at line 79 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::SizeLimitedContainer ( Base &&  other)
inline

Definition at line 92 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
template<typename Iter , typename = std::enable_if_t<std::is_base_of_v< std::input_iterator_tag, typename std::iterator_traits<Iter>::iterator_category>>>
kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::SizeLimitedContainer ( Iter  begin,
Iter  end 
)
inline

Definition at line 109 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::SizeLimitedContainer ( std::initializer_list< typename Base::value_type >  list)
inline

Definition at line 123 of file size_limited_containers.hpp.

Member Function Documentation

template<typename BaseContainer, std::size_t MaxSize>
void kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::assign ( typename Base::size_type  size,
const typename Base::value_type &  value 
)
inline

Definition at line 167 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
template<typename Iter , typename = std::enable_if_t<std::is_base_of_v< std::input_iterator_tag, typename std::iterator_traits<Iter>::iterator_category>>>
void kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::assign ( Iter  begin,
Iter  end 
)
inline

Definition at line 184 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
void kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::assign ( std::initializer_list< typename Base::value_type >  list)
inline

Definition at line 197 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
template<typename Iter , typename... Args, bool isIter = std::is_same_v<Iter, typename Base::iterator>, bool isConstIter = std::is_same_v<Iter, typename Base::const_iterator>, typename = std::enable_if_t<isIter or isConstIter>>
Base::iterator kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::emplace ( Iter  pos,
Args &&...  args 
)
inline

Definition at line 228 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
template<typename... Args>
Base::reference& kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::emplace_back ( Args &&...  args)
inline

Definition at line 210 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
template<typename Iter , bool isIter = std::is_same_v<Iter, typename Base::iterator>, bool isConstIter = std::is_same_v<Iter, typename Base::const_iterator>, typename = std::enable_if_t<isIter or isConstIter>>
Base::iterator kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::insert ( Iter  pos,
const typename Base::value_type &  value 
)
inline

Definition at line 245 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
template<typename Iter , bool isIter = std::is_same_v<Iter, typename Base::iterator>, bool isConstIter = std::is_same_v<Iter, typename Base::const_iterator>, typename = std::enable_if_t<isIter or isConstIter>>
Base::iterator kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::insert ( Iter  pos,
typename Base::size_type  size,
const typename Base::value_type &  value 
)
inline

Definition at line 263 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
template<typename OutIt , typename InIt , bool isIter = std::is_same_v<OutIt, typename Base::iterator>, bool isConstIter = std::is_same_v<OutIt, typename Base::const_iterator>, typename = std::enable_if_t<isIter or isConstIter>, typename = std::enable_if_t<std::is_base_of_v< std::input_iterator_tag, typename std::iterator_traits<InIt>::iterator_category>>>
Base::iterator kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::insert ( OutIt  pos,
InIt  begin,
InIt  end 
)
inline

Definition at line 287 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
template<typename Iter , bool isIter = std::is_same_v<Iter, typename Base::iterator>, bool isConstIter = std::is_same_v<Iter, typename Base::const_iterator>, typename = std::enable_if_t<isIter or isConstIter>>
Base::iterator kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::insert ( Iter  pos,
std::initializer_list< typename Base::value_type > &&  list 
)
inline

Definition at line 308 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
constexpr Base::size_type kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::max_size ( )
inline

Definition at line 47 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
bool kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::operator!= ( const Base other) const
inlinenoexcept

Definition at line 381 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
bool kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::operator!= ( const Span other) const
inlinenoexcept

Definition at line 385 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
bool kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::operator< ( const Base other) const
inlinenoexcept

Definition at line 389 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
bool kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::operator< ( const Span other) const
inlinenoexcept

Definition at line 394 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
SizeLimitedContainer& kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::operator= ( const Base other)
inline

Definition at line 126 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
SizeLimitedContainer& kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::operator= ( Base &&  other)
inline

Definition at line 139 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
SizeLimitedContainer& kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::operator= ( std::initializer_list< typename Base::value_type >  list)
inline

Definition at line 152 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
bool kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::operator== ( const Base other) const
inlinenoexcept

Definition at line 371 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
bool kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::operator== ( const Span other) const
inlinenoexcept

Definition at line 376 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
template<typename V >
void kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::push_back ( V &&  value)
inline

Definition at line 323 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
void kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::reserve ( typename Base::size_type  size)
inline

Definition at line 334 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
void kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::resize ( typename Base::size_type  size)
inline

Definition at line 346 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
void kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::resize ( typename Base::size_type  size,
const typename Base::value_type &  value 
)
inline

Definition at line 358 of file size_limited_containers.hpp.

Member Data Documentation

template<typename BaseContainer, std::size_t MaxSize>
constexpr bool kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::is_static_collection = false
static

Definition at line 45 of file size_limited_containers.hpp.

template<typename BaseContainer, std::size_t MaxSize>
constexpr bool kagome::common::SizeLimitedContainer< BaseContainer, MaxSize >::size_check_is_enabled
staticprotected
Initial value:
=
MaxSize < std::numeric_limits<typename Base::size_type>::max()

Definition at line 40 of file size_limited_containers.hpp.


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