jbson
C++11/1y BSON library
|
View on GitHub
namespace detail contains internal functions and classes More...
Typedefs | |
using | actual_element_type = boost::error_info< struct actual_element_type_, element_type > |
using | actual_size = boost::error_info< struct actual_size_, ptrdiff_t > |
using | actual_type = boost::error_info< struct actual_type_, std::type_index > |
template<typename CharT > | |
using | codecvt_t = typename codecvt< CharT >::type |
template<typename Container > | |
using | container_has_push_back = typename mpl::eval_if< has_iterator< std::decay_t< Container >>, container_has_push_back_impl< std::decay_t< Container >>, std::false_type >::type |
Type trait to determine if type is a container with a push_back() function. More... | |
template<element_type EType> | |
using | element_type_c = std::integral_constant< element_type, EType > |
Turns an element_type into a boost::mpl constant. | |
template<element_type EType, typename Container > | |
using | ElementTypeMap = typename mpl::at< typename TypeMap< Container >::map_type, element_type_c< EType >>::type |
Type alias to perform boost::mpl::at on TypeMap::map_type. More... | |
template<element_type EType, typename Container > | |
using | ElementTypeMapSet = typename mpl::at< typename TypeMap< Container, true >::map_type, element_type_c< EType >>::type |
Type alias to perform boost::mpl::at on TypeMap::map_type. More... | |
using | expected_element_type = boost::error_info< struct expected_element_type_, element_type > |
using | expected_size = boost::error_info< struct expected_size_, ptrdiff_t > |
using | expected_type = boost::error_info< struct expected_type_, std::type_index > |
template<typename MapT , typename FunT > | |
using | find_if_second = typename mpl::find_if< MapT, mpl::bind< mpl::protect< FunT >, mpl::bind< mpl::quote1< mpl::second >, mpl::_1 >>>::type |
template<typename MapT , typename T > | |
using | find_second = typename mpl::find_if< MapT, mpl::bind< quote< std::is_same >, T, mpl::bind< mpl::quote1< mpl::second >, mpl::_1 >>>::type |
template<typename RangeT , typename ElementTrait , typename RangeTrait > | |
using | is_range_of = typename mpl::apply< typename mpl::eval_if< is_range< RangeT >, mpl::identity< ElementTrait >, mpl::identity< mpl::always< mpl::false_ >>>::type, typename mpl::eval_if< is_range< RangeT >, mpl::apply< RangeTrait, std::decay_t< RangeT >>, mpl::identity< void >>::type >::type |
Type trait to apply a unary metafunction to the result of a Range trait in a SFINAE safe manner. More... | |
template<typename RangeT , typename ElementTrait > | |
using | is_range_of_iterator = is_range_of< RangeT, ElementTrait, mpl::quote1< boost::range_mutable_iterator >> |
Type trait to apply a unary metafunction trait to the iterator type of a Range. More... | |
template<typename RangeT , typename ElementT > | |
using | is_range_of_same_value = is_range_of_value< RangeT, mpl::bind2< mpl::quote2< std::is_same >, ElementT, mpl::_1 >> |
Type trait to determine equivalence of the value_type of a Range. More... | |
template<typename RangeT , typename ElementTrait > | |
using | is_range_of_value = is_range_of< RangeT, ElementTrait, mpl::quote1< boost::range_value >> |
Type trait to apply a unary metafunction trait to the value_type of a Range. More... | |
template<typename Container , typename T > | |
using | is_valid_element_set_type = typename mpl::not_< std::is_same< typename mpl::end< typename TypeMap< Container, true >::map_type >::type, find_if_second< typename TypeMap< Container, true >::map_type, mpl::bind< quote< is_constructible >, mpl::_1, T >>>>::type |
template<typename Container , typename T > | |
using | is_valid_element_value_type = typename mpl::not_< std::is_same< typename mpl::end< typename TypeMap< Container >::map_type >::type, find_if_second< typename TypeMap< Container >::map_type, mpl::bind< quote< is_convertible >, T, mpl::_1 >>>>::type |
Functions | |
template<typename RangeT , typename ArithT > | |
void | deserialise (const RangeT &data, ArithT &num, std::enable_if_t< std::is_arithmetic< ArithT >::value > *=nullptr) |
template<typename RangeT , typename StringT > | |
void | deserialise (const RangeT &data, StringT &str, std::enable_if_t< std::is_convertible< std::decay_t< StringT >, boost::string_ref >::value > *=nullptr) |
template<typename RangeT , typename Container , typename EContainer > | |
void | deserialise (const RangeT &data, basic_document< Container, EContainer > &doc) |
template<typename RangeT , typename Container , typename EContainer > | |
void | deserialise (const RangeT &data, basic_array< Container, EContainer > &arr) |
template<typename RangeT > | |
void | deserialise (const RangeT &data, std::vector< char > &vec) |
template<typename RangeT > | |
void | deserialise (const RangeT &data, RangeT &vec) |
template<typename RangeT > | |
void | deserialise (const RangeT &data, std::array< char, 12 > &oid) |
template<typename RangeT , typename StringT > | |
void | deserialise (const RangeT &data, std::tuple< StringT, StringT > &tuple, std::enable_if_t< std::is_constructible< std::string, std::decay_t< StringT >>::value > *=nullptr) |
template<typename RangeT , typename StringT > | |
void | deserialise (const RangeT &data, std::tuple< StringT, std::array< char, 12 >> &tuple, std::enable_if_t< std::is_constructible< std::string, std::decay_t< StringT >>::value > *=nullptr) |
template<typename RangeT , typename StringT , typename DocContainerT , typename DocEContainerT > | |
void | deserialise (const RangeT &data, std::tuple< StringT, basic_document< DocContainerT, DocEContainerT >> &tuple, std::enable_if_t< std::is_constructible< std::string, std::decay_t< StringT >>::value > *=nullptr) |
template<typename Container > | |
void | init_empty (Container &c) |
Initialises a container or range for a valid empty basic_document or basic_array. | |
template<typename CharT > | |
constexpr bool | iscntrl (CharT c) |
template<typename CharT > | |
constexpr bool | isdigit (CharT c) |
template<typename CharT > | |
constexpr bool | isspace (CharT c) |
template<typename CharT > | |
constexpr bool | isxdigit (CharT c) |
template<typename T , typename ForwardIterator > | |
T | little_endian_to_native (ForwardIterator first, ForwardIterator last) |
template<typename T > | |
std::array< char, sizeof(T)> | native_to_little_endian (T val) |
template<typename ElemRangeT , typename StrRngT , typename OutIterator > | |
void | select (ElemRangeT &&doc, StrRngT path, OutIterator out) |
template<typename ElemRangeT , typename StrRngT , typename OutIterator > | |
void | select_expr (ElemRangeT &&doc, StrRngT path, StrRngT expr, OutIterator out) |
template<typename ElemRangeT , typename StrRngT , typename OutIterator > | |
void | select_name (ElemRangeT &&doc, StrRngT path, StrRngT name, OutIterator out) |
template<typename ElemRangeT , typename StrRngT , typename OutIterator > | |
void | select_sub (ElemRangeT &&doc, StrRngT path, StrRngT subscript, OutIterator out) |
template<typename Container , typename IteratorT , typename T > | |
void | serialise (Container &c, IteratorT &it, T val, std::enable_if_t< std::is_arithmetic< T >::value > *=nullptr) |
template<typename Container , typename IteratorT > | |
void | serialise (Container &c, IteratorT &it, boost::string_ref val) |
template<typename Container , typename IteratorT , typename DocContainer , typename DocEContainer > | |
void | serialise (Container &c, IteratorT &it, const basic_document< DocContainer, DocEContainer > &val) |
template<typename Container , typename IteratorT , typename DocContainer , typename DocEContainer > | |
void | serialise (Container &c, IteratorT &it, const basic_array< DocContainer, DocEContainer > &val) |
template<typename Container , typename IteratorT > | |
void | serialise (Container &c, IteratorT &it, const std::array< char, 12 > &val) |
template<typename Container , typename IteratorT , typename StringT > | |
void | serialise (Container &c, IteratorT &it, const std::tuple< StringT, StringT > &val, std::enable_if_t< std::is_convertible< StringT, boost::string_ref >::value > *=nullptr) |
template<typename Container , typename IteratorT , typename StringT > | |
void | serialise (Container &c, IteratorT &it, const std::tuple< StringT, std::array< char, 12 >> &val) |
template<typename Container , typename IteratorT , typename StringT , typename DocContainer , typename DocEContainer > | |
void | serialise (Container &, IteratorT &, const std::tuple< StringT, basic_document< DocContainer, DocEContainer >> &, std::enable_if_t< std::is_convertible< StringT, boost::string_ref >::value > *=nullptr) |
bool | valid_type (element_type etype) |
template<template< element_type EType, typename...VArgs > class Visitor, typename... Args> | |
std::enable_if_t< std::is_void < decltype(std::declval < Visitor < element_type::int64_element, Args...>>()(std::declval< Args && > )...))>::value > | visit (element_type type, Args &&...args) |
void visit. More... | |
template<template< element_type EType, typename...VArgs > class Visitor, typename... Args> | |
std::enable_if_t<!std::is_void < decltype(std::declval < Visitor < element_type::int64_element, Args...>>()(std::declval< Args && > )...))>::value, decltype(std::declval < Visitor < element_type::int64_element, Args...>>()(std::declval< Args && >)...))> | visit (element_type type, Args &&...args) |
Non-void visit. More... | |
namespace detail contains internal functions and classes
using jbson::detail::container_has_push_back = typedef typename mpl::eval_if<has_iterator<std::decay_t<Container>>, container_has_push_back_impl<std::decay_t<Container>>, std::false_type>::type |
Type trait to determine if type is a container with a push_back() function.
Evaluates to std::false_type for all incompatible types (SFINAE friendly).
Definition at line 183 of file traits.hpp.
using jbson::detail::ElementTypeMap = typedef typename mpl::at<typename TypeMap<Container>::map_type, element_type_c<EType>>::type |
Type alias to perform boost::mpl::at on TypeMap::map_type.
Maps an element_type to a type for deserialisation.
Definition at line 137 of file traits.hpp.
using jbson::detail::ElementTypeMapSet = typedef typename mpl::at<typename TypeMap<Container, true>::map_type, element_type_c<EType>>::type |
Type alias to perform boost::mpl::at on TypeMap::map_type.
Same as ElementTypeMap, but for serialising types rather than deserialising.
Definition at line 146 of file traits.hpp.
using jbson::detail::is_range_of = typedef typename mpl::apply< typename mpl::eval_if<is_range<RangeT>, mpl::identity<ElementTrait>, mpl::identity<mpl::always<mpl::false_>>>::type, typename mpl::eval_if<is_range<RangeT>, mpl::apply<RangeTrait, std::decay_t<RangeT>>, mpl::identity<void>>::type>::type |
Type trait to apply a unary metafunction to the result of a Range trait in a SFINAE safe manner.
Definition at line 198 of file traits.hpp.
using jbson::detail::is_range_of_iterator = typedef is_range_of<RangeT, ElementTrait, mpl::quote1<boost::range_mutable_iterator>> |
Type trait to apply a unary metafunction trait to the iterator type of a Range.
Definition at line 219 of file traits.hpp.
using jbson::detail::is_range_of_same_value = typedef is_range_of_value<RangeT, mpl::bind2<mpl::quote2<std::is_same>, ElementT, mpl::_1>> |
Type trait to determine equivalence of the value_type of a Range.
Definition at line 212 of file traits.hpp.
using jbson::detail::is_range_of_value = typedef is_range_of<RangeT, ElementTrait, mpl::quote1<boost::range_value>> |
Type trait to apply a unary metafunction trait to the value_type of a Range.
Definition at line 205 of file traits.hpp.
std::enable_if_t<std::is_void< decltype(std::declval<Visitor<element_type::int64_element, Args...>>()(std::declval<Args&&>)...))>::value> jbson::detail::visit | ( | element_type | type, |
Args &&... | args | ||
) |
void visit.
invalid_element_type | When type is invalid. |
std::enable_if_t<!std::is_void<decltype( std::declval<Visitor<element_type::int64_element, Args...>>()(std::declval<Args&&>)...))>::value, decltype(std::declval<Visitor<element_type::int64_element, Args...>>()(std::declval<Args&&>)...))> jbson::detail::visit | ( | element_type | type, |
Args &&... | args | ||
) |
Non-void visit.
invalid_element_type | When type is invalid. |