DAW JSON Link
Classes | Typedefs | Functions | Variables
daw::json::anonymous_namespace{daw_json_traits.h} Namespace Reference

Classes

struct  tuple_elements_pack
 Allow tuple like types to be used in json_tuple. More...
 
struct  tuple_elements_pack< daw::fwd_pack< Ts... > >
 
struct  tuple_elements_pack< std::tuple< Ts... > >
 

Typedefs

template<typename T >
using can_single_allocation_string = std::bool_constant< can_single_allocation_string_v< T > >
 
template<typename T >
using is_zero_terminated_string = std::bool_constant< is_zero_terminated_string_v< T > >
 

Functions

 DAW_JSON_MAKE_REQ_TYPE_ALIAS_TRAIT (ignore_unknown_members_v, json_data_contract< T >::ignore_unknown_members)
 
 DAW_JSON_MAKE_REQ_TYPE_ALIAS_TRAIT (is_exact_class_mapping_v, json_data_contract< T >::exact_class_mapping)
 

Variables

template<typename >
constexpr bool can_single_allocation_string_v = false
 Can use the fast, pseudo random string iterators. They are InputIterators with an operator- that allows for O(1) distance calculations as we often know the length but cannot provide random access. For types that only use InputIterator operations and last - first for distance calc. More...
 
template<typename T >
constexpr bool force_aggregate_construction_v
 
template<typename... Ts>
constexpr bool is_empty_pack_v = sizeof...( Ts ) == 0
 
template<typename T >
constexpr bool is_pinned_type_v
 Is the type pinned in memory and unable to be copied/moved after construction(e.g. std::mutex). These types require using RVO in order to be used but that can have a penalty as std::current_exceptions( ) must be checked which is quite noticeable on MSVC. More...
 
template<typename T >
constexpr bool is_pointer_like_v
 
template<typename >
constexpr bool is_zero_terminated_string_v = false
 
template<typename Constructor , typename T , typename ParseState >
constexpr bool should_construct_explicitly_v
 

Typedef Documentation

◆ can_single_allocation_string

template<typename T >
using daw::json::anonymous_namespace{daw_json_traits.h}::can_single_allocation_string = typedef std::bool_constant<can_single_allocation_string_v<T> >

Definition at line 176 of file daw_json_traits.h.

◆ is_zero_terminated_string

template<typename T >
using daw::json::anonymous_namespace{daw_json_traits.h}::is_zero_terminated_string = typedef std::bool_constant<is_zero_terminated_string_v<T> >

Definition at line 235 of file daw_json_traits.h.

Function Documentation

◆ DAW_JSON_MAKE_REQ_TYPE_ALIAS_TRAIT() [1/2]

daw::json::anonymous_namespace{daw_json_traits.h}::DAW_JSON_MAKE_REQ_TYPE_ALIAS_TRAIT ( ignore_unknown_members_v  ,
json_data_contract< T >::ignore_unknown_members   
)

◆ DAW_JSON_MAKE_REQ_TYPE_ALIAS_TRAIT() [2/2]

daw::json::anonymous_namespace{daw_json_traits.h}::DAW_JSON_MAKE_REQ_TYPE_ALIAS_TRAIT ( is_exact_class_mapping_v  ,
json_data_contract< T >::exact_class_mapping   
)

Variable Documentation

◆ can_single_allocation_string_v

template<typename >
constexpr bool daw::json::anonymous_namespace{daw_json_traits.h}::can_single_allocation_string_v = false
inlineconstexpr

Can use the fast, pseudo random string iterators. They are InputIterators with an operator- that allows for O(1) distance calculations as we often know the length but cannot provide random access. For types that only use InputIterator operations and last - first for distance calc.

Definition at line 169 of file daw_json_traits.h.

◆ force_aggregate_construction_v

template<typename T >
constexpr bool daw::json::anonymous_namespace{daw_json_traits.h}::force_aggregate_construction_v
inlineconstexpr
Initial value:
=
json_details::force_aggregate_construction_test1<T> or
json_details::force_aggregate_construction_test2<T>

Definition at line 100 of file daw_json_traits.h.

◆ is_empty_pack_v

template<typename... Ts>
constexpr bool daw::json::anonymous_namespace{daw_json_traits.h}::is_empty_pack_v = sizeof...( Ts ) == 0
inlineconstexpr

Definition at line 160 of file daw_json_traits.h.

◆ is_pinned_type_v

template<typename T >
constexpr bool daw::json::anonymous_namespace{daw_json_traits.h}::is_pinned_type_v
inlineconstexpr
Initial value:
= not(
(std::is_copy_constructible_v<T> and std::is_copy_assignable_v<T>) or
( std::is_move_constructible_v<T> and std::is_move_assignable_v<T> ) )

Is the type pinned in memory and unable to be copied/moved after construction(e.g. std::mutex). These types require using RVO in order to be used but that can have a penalty as std::current_exceptions( ) must be checked which is quite noticeable on MSVC.

Template Parameters
Ttype to check

Definition at line 364 of file daw_json_traits.h.

◆ is_pointer_like_v

template<typename T >
constexpr bool daw::json::anonymous_namespace{daw_json_traits.h}::is_pointer_like_v
inlineconstexpr
Initial value:
=
std::is_pointer_v<T> or json_details::has_element_type<T>

Definition at line 319 of file daw_json_traits.h.

◆ is_zero_terminated_string_v

template<typename >
constexpr bool daw::json::anonymous_namespace{daw_json_traits.h}::is_zero_terminated_string_v = false
inlineconstexpr

Definition at line 227 of file daw_json_traits.h.

◆ should_construct_explicitly_v

template<typename Constructor , typename T , typename ParseState >
constexpr bool daw::json::anonymous_namespace{daw_json_traits.h}::should_construct_explicitly_v
inlineconstexpr
Initial value:
=
not json_details::has_data_contract_constructor_v<T> and
( force_aggregate_construction_v<T> or
json_details::is_default_default_constructor_type_v<Constructor> or
not json_details::has_stateless_allocator_v<ParseState> )

Definition at line 153 of file daw_json_traits.h.