userver: storages::postgres::io::traits Namespace Reference
Loading...
Searching...
No Matches
storages::postgres::io::traits Namespace Reference

Detailed Description

uPg input-output traits.

Namespace with metafunctions detecting different type traits needed for PostgreSQL input-output operations

Classes

struct  AddTupleConstRef
 
struct  AddTupleConstRef< std::tuple< T... > >
 
struct  BitContainerTraits
 
struct  BitContainerTraits< BitContainer, std::enable_if_t< std::is_integral_v< BitContainer > > >
 
struct  BitContainerTraits< std::array< bool, N > >
 
struct  BitContainerTraits< std::bitset< N > >
 
struct  CanClear
 
struct  CanClear< T, ::utils::void_t< decltype(std::declval< T >().clear())> >
 
struct  CanReserve
 
struct  CanReserve< T, ::utils::void_t< decltype(std::declval< T >().reserve(std::declval< std::size_t >()))> >
 
struct  CanResize
 
struct  CanResize< T, ::utils::void_t< decltype(std::declval< T >().resize(std::declval< std::size_t >()))> >
 
struct  CanUseEnumAsStrongTypedef
 
struct  ContainerFinalElement
 Detect type of multidimensional C++ container. More...
 
struct  DimensionCount
 Calculate number of dimensions in C++ container. More...
 
struct  DimensionCount< T, std::enable_if_t< kIsCompatibleContainer< T > > >
 
struct  DimensionSize
 
struct  DimensionSize< std::array< T, N > >
 
struct  ExtractionTag
 
struct  ExtractionTag< T, std::enable_if_t< kIsRowType< T > > >
 
struct  FixedDimensions
 
struct  GetSetNull
 
struct  GetSetNull< boost::optional< T > >
 
struct  GetSetNull< Null< T > >
 
struct  GetSetNull< std::optional< T > >
 
struct  GetSetNull<::utils::OptionalRef< T > >
 
struct  GetSetNull<::utils::StrongTypedef< Tag, T, Ops, Enable > >
 
struct  HasFixedDimensions
 
struct  HasFormatter
 Metafunction to detect if a type has a formatter. More...
 
struct  HasInputOperator
 
struct  HasInputOperator< T, ::utils::void_t< decltype(std::declval< std::istream & >() > > std::declval< T & >())> >
 
struct  HasIntrospection
 
struct  HasOutputOperator
 
struct  HasOutputOperator< T, ::utils::void_t< decltype(std::declval< std::ostream & >()<< std::declval< T & >())> >
 
struct  HasParser
 Metafunction to detect if a type has a parser. More...
 
struct  Input
 Customisation point for parsers. More...
 
struct  Input< BoundedRange< T >, std::enable_if_t< kHasParser< T > > >
 
struct  Input< formats::json::Value >
 
struct  Input< io::detail::Box >
 
struct  Input< io::detail::Circle >
 
struct  Input< io::detail::Line >
 
struct  Input< io::detail::LineSegment >
 
struct  Input< io::detail::Path >
 
struct  Input< io::detail::Point >
 
struct  Input< io::detail::Polygon >
 
struct  Input< Range< T >, std::enable_if_t< kHasParser< T > > >
 
struct  Input< std::chrono::duration< Rep, Period > >
 Binary parser for std::chrono::duration. More...
 
struct  Input< T, EnableIfCanUseEnumAsStrongTypedef< T > >
 
struct  Input< T, std::enable_if_t<!detail::kCustomParserDefined< T > &&io::detail::kEnableArrayParser< T > > >
 
struct  Input< T, std::enable_if_t<!detail::kCustomParserDefined< T > &&kIsRowType< T > > >
 
struct  IO
 A default deducer of parsers/formatters for a type/data format. Can be specialised for a type/format pair providing custom parsers/formatters. More...
 
struct  IsBitStringCompatible
 
struct  IsBitStringCompatible< std::array< bool, N > >
 
struct  IsBitStringCompatible< std::bitset< N > >
 
struct  IsBitStringCompatible<::utils::Flags< Enum > >
 
struct  IsByteaCompatible
 
struct  IsByteaCompatible< std::string >
 
struct  IsByteaCompatible< std::string_view >
 
struct  IsByteaCompatible< std::vector< char, VectorArgs... > >
 
struct  IsByteaCompatible< std::vector< unsigned char, VectorArgs... > >
 
struct  IsCompatibleContainer
 Mark C++ container type as supported by the driver. More...
 
struct  IsCompatibleContainer< io::detail::ContainerChunk< Container > >
 
struct  IsCompatibleContainer< std::array< T, Size > >
 
struct  IsCompatibleContainer< std::set< T... > >
 
struct  IsCompatibleContainer< std::unordered_set< T... > >
 
struct  IsCompatibleContainer< std::vector< T... > >
 
struct  IsCompatibleContainer<::utils::impl::ProjectingView< const Container, Projection > >
 
struct  IsMappedToArray
 Detect if the C++ type is mapped to a Postgres array type. More...
 
struct  IsMappedToPg
 Detect if the C++ type is mapped to a Postgres type. More...
 
struct  IsMappedToPg< boost::optional< T > >
 
struct  IsMappedToPg< Null< T > >
 
struct  IsMappedToPg< std::optional< T > >
 
struct  IsMappedToPg< T, EnableIfCanUseEnumAsStrongTypedef< T > >
 
struct  IsMappedToPg<::utils::OptionalRef< T > >
 
struct  IsMappedToPg<::utils::StrongTypedef< Tag, T, Ops, Enable > >
 
struct  IsMappedToSystemType
 Detect if the C++ type is mapped to a Postgres system type. More...
 
struct  IsMappedToUserType
 Detect if the C++ type is mapped to a Postgres user type. More...
 
struct  IsNullable
 Metafunction to detect nullability of a type. More...
 
struct  IsNullable< boost::optional< T > >
 Nullability traits for boost::optional. More...
 
struct  IsNullable< Null< T > >
 
struct  IsNullable< std::optional< T > >
 Nullability traits for std::optional. More...
 
struct  IsNullable<::utils::OptionalRef< T > >
 Nullability traits for USERVER_NAMESPACE::utils::OptionalRef. More...
 
struct  IsNullable<::utils::StrongTypedef< Tag, T, Ops, Enable > >
 
struct  IsSpecialMapping
 Mark C++ mapping a special case for disambiguation. More...
 
struct  IsSpecialMapping< boost::optional< T > >
 
struct  IsSpecialMapping< Null< T > >
 
struct  IsSpecialMapping< std::optional< T > >
 
struct  IsSpecialMapping< T, EnableIfCanUseEnumAsStrongTypedef< T > >
 
struct  IsSpecialMapping<::utils::OptionalRef< T > >
 
struct  IsSpecialMapping<::utils::StrongTypedef< Tag, T, Ops, Enable > >
 
struct  IsSuitableRowType
 
struct  IsSuitableRowType<::utils::StrongTypedef< Tag, T, Ops, Enable > >
 
struct  IsTuple
 
struct  IsTuple< std::tuple< T... > >
 
struct  IsTupleOfRefs
 
struct  IsTupleOfRefs< std::tuple< T &... > >
 
struct  Output
 Customisation point for formatters. More...
 
struct  Output< BoundedRange< T >, std::enable_if_t< kHasFormatter< T > > >
 
struct  Output< formats::json::Value >
 
struct  Output< io::detail::Box >
 
struct  Output< io::detail::Circle >
 
struct  Output< io::detail::Line >
 
struct  Output< io::detail::LineSegment >
 
struct  Output< io::detail::Path >
 
struct  Output< io::detail::Point >
 
struct  Output< io::detail::Polygon >
 
struct  Output< PlainJson >
 
struct  Output< Range< T >, std::enable_if_t< kHasFormatter< T > > >
 
struct  Output< std::chrono::duration< Rep, Period > >
 Binary formatter for std::chrono::duration. More...
 
struct  Output< T, EnableIfCanUseEnumAsStrongTypedef< T > >
 
struct  Output< T, std::enable_if_t<!detail::kCustomFormatterDefined< T > &&io::detail::kEnableArrayFormatter< T > > >
 
struct  Output< T, std::enable_if_t<!detail::kCustomFormatterDefined< T > &&kIsMappedToUserType< T > &&kIsRowType< T > > >
 
struct  ParserBufferCategory
 Buffer category for parser. More...
 
struct  ParserBufferCategory< BufferParser< boost::optional< T > > >
 
struct  ParserBufferCategory< BufferParser< std::optional< T > > >
 
struct  ParserBufferCategory< BufferParser<::utils::StrongTypedef< Tag, T, Ops, Enable > > >
 
struct  ParserBufferCategory< io::detail::ArrayBinaryParser< T > >
 
struct  ParserBufferCategory< io::detail::BoundedRangeBinaryParser< T > >
 
struct  ParserBufferCategory< io::detail::BoxParser >
 
struct  ParserBufferCategory< io::detail::CircleParser >
 
struct  ParserBufferCategory< io::detail::CompositeBinaryParser< T > >
 
struct  ParserBufferCategory< io::detail::EnumParser< T > >
 
struct  ParserBufferCategory< io::detail::JsonParser >
 
struct  ParserBufferCategory< io::detail::LineParser >
 
struct  ParserBufferCategory< io::detail::LineSegmentParser >
 
struct  ParserBufferCategory< io::detail::PathParser >
 
struct  ParserBufferCategory< io::detail::PointParser >
 
struct  ParserBufferCategory< io::detail::PolygonParser >
 
struct  ParserBufferCategory< io::detail::RangeBinaryParser< T > >
 
struct  RemoveTupleReferences
 
struct  RemoveTupleReferences< std::tuple< T... > >
 
struct  RowCategory
 
struct  RowCategory<::utils::StrongTypedef< Tag, T, Ops, Enable > >
 
struct  TupleHasFormatters
 
struct  TupleHasFormatters< std::tuple< T... > >
 
struct  TupleHasParsers
 
struct  TupleHasParsers< std::tuple< T... > >
 
struct  TypeBufferCategory
 

Typedefs

template<bool Value>
using BoolConstant = std::integral_constant<bool, Value>
 
template<std::size_t Value>
using SizeConstant = std::integral_constant<std::size_t, Value>
 
template<typename T >
using EnableIfByteaCompatible = std::enable_if_t<IsByteaCompatible<T>{}>
 
template<typename T >
using EnableIfCanUseEnumAsStrongTypedef = std::enable_if_t<impl::CheckCanUseEnumAsStrongTypedef<T>()>
 

Functions

template<typename T , T... Values>
constexpr std::array< T, sizeof...(Values)> MakeArray (const std::integer_sequence< T, Values... > &)
 

Variables

template<typename T >
constexpr bool kIsNullable = IsNullable<T>::value
 
template<typename T >
constexpr bool kIsByteaCompatible = IsByteaCompatible<T>::value
 
template<typename Container >
constexpr bool kHasFixedDimensions = HasFixedDimensions<Container>::value
 
template<typename T >
constexpr std::size_t kDimensionSize = DimensionSize<T>::value
 
template<typename Tag , typename T , ::utils::StrongTypedefOps Ops, typename Enable >
constexpr bool kIsStrongTypedefDirectlyMapped
 
template<typename T >
constexpr bool kIsBitStringCompatible = IsBitStringCompatible<T>::value
 
Type mapping traits
template<typename T >
constexpr bool kIsMappedToSystemType = IsMappedToSystemType<T>::value
 
template<typename T >
constexpr bool kIsMappedToUserType = IsMappedToUserType<T>::value
 
template<typename T >
constexpr bool kIsMappedToArray = IsMappedToArray<T>::value
 
template<typename T >
constexpr bool kIsMappedToPg = IsMappedToPg<T>::value
 
template<typename T >
constexpr bool kIsSpecialMapping = IsSpecialMapping<T>::value
 
Buffer category for a type
template<typename T >
constexpr BufferCategory kTypeBufferCategory = TypeBufferCategory<T>::value
 

Row type traits

enum class  RowCategoryType {
  kNonRow ,
  kTuple ,
  kAggregate ,
  kIntrusiveIntrospection
}
 
template<RowCategoryType Tag>
using RowCategoryConstant = std::integral_constant<RowCategoryType, Tag>
 
template<typename T >
constexpr bool kIsSuitableRowType = IsSuitableRowType<T>::value
 
template<typename T >
constexpr RowCategoryType kRowCategory = RowCategory<T>::value
 
template<typename T >
constexpr bool kIsRowType = kRowCategory<T> != RowCategoryType::kNonRow
 
template<typename T >
constexpr bool kIsCompositeType = kIsRowType<T>
 
template<typename T >
constexpr bool kIsColumnType = kRowCategory<T> == RowCategoryType::kNonRow
 
template<typename T >
constexpr ExtractionTag< T >::type kExtractionTag {}
 
template<typename T >
constexpr void AssertIsValidRowType ()
 

Traits for containers

template<typename T >
using ContainerFinaleElementType = typename ContainerFinalElement<T>::type
 
template<typename T >
constexpr bool kIsCompatibleContainer = IsCompatibleContainer<T>::value
 
template<typename T >
constexpr bool kIsFixedSizeContainer = meta::kIsFixedSizeContainer<T>
 
template<typename T >
constexpr std::size_t kDimensionCount = DimensionCount<T>::value
 

Shortcut metafunction result values

template<typename T >
using ParserBufferCategoryType = typename ParserBufferCategory<T>::type
 
template<typename T >
constexpr bool kHasParser = HasParser<T>::value
 
template<typename T >
constexpr bool kHasFormatter = HasFormatter<T>::value
 
template<typename T >
constexpr BufferCategory kParserBufferCategory = ParserBufferCategory<T>::value
 
template<typename T >
constexpr bool CheckParser ()
 
template<typename T >
constexpr void CheckFormatter ()
 

IsMappedToArray implementation

template<typename T >
constexpr bool kCanReserve = CanReserve<T>::value
 
template<typename T >
constexpr bool kCanResize = CanResize<T>::value
 
template<typename T >
constexpr bool kCanClear = CanClear<T>::value
 
template<typename T >
auto Inserter (T &container)
 

Typedef Documentation

◆ BoolConstant

template<bool Value>
using storages::postgres::io::traits::BoolConstant = std::integral_constant<bool, Value>

Definition at line 18 of file type_traits.hpp.

◆ ContainerFinaleElementType

template<typename T >
using storages::postgres::io::traits::ContainerFinaleElementType = typename ContainerFinalElement<T>::type

Definition at line 124 of file type_traits.hpp.

◆ EnableIfByteaCompatible

template<typename T >
using storages::postgres::io::traits::EnableIfByteaCompatible = std::enable_if_t<IsByteaCompatible<T>{}>

Definition at line 38 of file bytea.hpp.

◆ EnableIfCanUseEnumAsStrongTypedef

template<typename T >
using storages::postgres::io::traits::EnableIfCanUseEnumAsStrongTypedef = std::enable_if_t<impl::CheckCanUseEnumAsStrongTypedef<T>()>

Definition at line 102 of file strong_typedef.hpp.

◆ ParserBufferCategoryType

template<typename T >
using storages::postgres::io::traits::ParserBufferCategoryType = typename ParserBufferCategory<T>::type

Definition at line 173 of file traits.hpp.

◆ RowCategoryConstant

template<RowCategoryType Tag>
using storages::postgres::io::traits::RowCategoryConstant = std::integral_constant<RowCategoryType, Tag>

Definition at line 119 of file row_types.hpp.

◆ SizeConstant

template<std::size_t Value>
using storages::postgres::io::traits::SizeConstant = std::integral_constant<std::size_t, Value>

Definition at line 20 of file type_traits.hpp.

Enumeration Type Documentation

◆ RowCategoryType

enum class storages::postgres::io::traits::RowCategoryType
strong

Definition at line 116 of file row_types.hpp.

Function Documentation

◆ AssertIsValidRowType()

template<typename T >
constexpr void storages::postgres::io::traits::AssertIsValidRowType ( )
constexpr

Definition at line 140 of file row_types.hpp.

◆ CheckFormatter()

template<typename T >
constexpr void storages::postgres::io::traits::CheckFormatter ( )
constexpr

Definition at line 152 of file traits.hpp.

◆ CheckParser()

template<typename T >
constexpr bool storages::postgres::io::traits::CheckParser ( )
constexpr

Definition at line 132 of file traits.hpp.

◆ Inserter()

template<typename T >
auto storages::postgres::io::traits::Inserter ( T & container)

Definition at line 173 of file type_traits.hpp.

◆ MakeArray()

template<typename T , T... Values>
constexpr std::array< T, sizeof...(Values)> storages::postgres::io::traits::MakeArray ( const std::integer_sequence< T, Values... > & )
constexpr

Definition at line 92 of file array_types.hpp.

Variable Documentation

◆ kCanClear

template<typename T >
constexpr bool storages::postgres::io::traits::kCanClear = CanClear<T>::value
inlineconstexpr

Definition at line 170 of file type_traits.hpp.

◆ kCanReserve

template<typename T >
constexpr bool storages::postgres::io::traits::kCanReserve = CanReserve<T>::value
inlineconstexpr

Definition at line 153 of file type_traits.hpp.

◆ kCanResize

template<typename T >
constexpr bool storages::postgres::io::traits::kCanResize = CanResize<T>::value
inlineconstexpr

Definition at line 162 of file type_traits.hpp.

◆ kDimensionCount

template<typename T >
constexpr std::size_t storages::postgres::io::traits::kDimensionCount = DimensionCount<T>::value
inlineconstexpr

Definition at line 96 of file type_traits.hpp.

◆ kDimensionSize

template<typename T >
constexpr std::size_t storages::postgres::io::traits::kDimensionSize = DimensionSize<T>::value
inlineconstexpr

Definition at line 64 of file array_types.hpp.

◆ kExtractionTag

template<typename T >
constexpr ExtractionTag<T>::type storages::postgres::io::traits::kExtractionTag {}
inlineconstexpr

Definition at line 173 of file row_types.hpp.

◆ kHasFixedDimensions

template<typename Container >
constexpr bool storages::postgres::io::traits::kHasFixedDimensions = HasFixedDimensions<Container>::value
inlineconstexpr

Definition at line 52 of file array_types.hpp.

◆ kHasFormatter

template<typename T >
constexpr bool storages::postgres::io::traits::kHasFormatter = HasFormatter<T>::value
inlineconstexpr

Definition at line 128 of file traits.hpp.

◆ kHasParser

template<typename T >
constexpr bool storages::postgres::io::traits::kHasParser = HasParser<T>::value
inlineconstexpr

Definition at line 126 of file traits.hpp.

◆ kIsBitStringCompatible

template<typename T >
constexpr bool storages::postgres::io::traits::kIsBitStringCompatible = IsBitStringCompatible<T>::value
inlineconstexpr

Definition at line 36 of file bitstring.hpp.

◆ kIsByteaCompatible

template<typename T >
constexpr bool storages::postgres::io::traits::kIsByteaCompatible = IsByteaCompatible<T>::value
inlineconstexpr

Definition at line 35 of file bytea.hpp.

◆ kIsColumnType

template<typename T >
constexpr bool storages::postgres::io::traits::kIsColumnType = kRowCategory<T> == RowCategoryType::kNonRow
inlineconstexpr

Definition at line 160 of file row_types.hpp.

◆ kIsCompatibleContainer

template<typename T >
constexpr bool storages::postgres::io::traits::kIsCompatibleContainer = IsCompatibleContainer<T>::value
inlineconstexpr

Definition at line 82 of file type_traits.hpp.

◆ kIsCompositeType

template<typename T >
constexpr bool storages::postgres::io::traits::kIsCompositeType = kIsRowType<T>
inlineconstexpr

Definition at line 157 of file row_types.hpp.

◆ kIsFixedSizeContainer

template<typename T >
constexpr bool storages::postgres::io::traits::kIsFixedSizeContainer = meta::kIsFixedSizeContainer<T>
inlineconstexpr

Definition at line 85 of file type_traits.hpp.

◆ kIsMappedToArray

template<typename T >
constexpr bool storages::postgres::io::traits::kIsMappedToArray = IsMappedToArray<T>::value
inlineconstexpr

Definition at line 40 of file type_traits.hpp.

◆ kIsMappedToPg

template<typename T >
constexpr bool storages::postgres::io::traits::kIsMappedToPg = IsMappedToPg<T>::value
inlineconstexpr

Definition at line 46 of file type_traits.hpp.

◆ kIsMappedToSystemType

template<typename T >
constexpr bool storages::postgres::io::traits::kIsMappedToSystemType = IsMappedToSystemType<T>::value
inlineconstexpr

Definition at line 28 of file type_traits.hpp.

◆ kIsMappedToUserType

template<typename T >
constexpr bool storages::postgres::io::traits::kIsMappedToUserType = IsMappedToUserType<T>::value
inlineconstexpr

Definition at line 34 of file type_traits.hpp.

◆ kIsNullable

template<typename T >
constexpr bool storages::postgres::io::traits::kIsNullable = IsNullable<T>::value
inlineconstexpr

Definition at line 16 of file nullable_traits.hpp.

◆ kIsRowType

template<typename T >
constexpr bool storages::postgres::io::traits::kIsRowType = kRowCategory<T> != RowCategoryType::kNonRow
inlineconstexpr

Definition at line 154 of file row_types.hpp.

◆ kIsSpecialMapping

template<typename T >
constexpr bool storages::postgres::io::traits::kIsSpecialMapping = IsSpecialMapping<T>::value
inlineconstexpr

Definition at line 52 of file type_traits.hpp.

◆ kIsStrongTypedefDirectlyMapped

template<typename Tag , typename T , ::utils::StrongTypedefOps Ops, typename Enable >
constexpr bool storages::postgres::io::traits::kIsStrongTypedefDirectlyMapped
inlineconstexpr
Initial value:
=
kIsMappedToUserType<::utils::StrongTypedef<Tag, T, Ops, Enable>> ||
kIsMappedToSystemType<::utils::StrongTypedef<Tag, T, Ops, Enable>> ||
kIsMappedToArray<::utils::StrongTypedef<Tag, T, Ops, Enable>>

Definition at line 45 of file strong_typedef.hpp.

◆ kIsSuitableRowType

template<typename T >
constexpr bool storages::postgres::io::traits::kIsSuitableRowType = IsSuitableRowType<T>::value
inlineconstexpr

Definition at line 114 of file row_types.hpp.

◆ kParserBufferCategory

template<typename T >
constexpr BufferCategory storages::postgres::io::traits::kParserBufferCategory = ParserBufferCategory<T>::value
inlineconstexpr

Definition at line 175 of file traits.hpp.

◆ kRowCategory

template<typename T >
constexpr RowCategoryType storages::postgres::io::traits::kRowCategory = RowCategory<T>::value
inlineconstexpr

Definition at line 137 of file row_types.hpp.

◆ kTypeBufferCategory

template<typename T >
constexpr BufferCategory storages::postgres::io::traits::kTypeBufferCategory = TypeBufferCategory<T>::value
inlineconstexpr

Definition at line 192 of file traits.hpp.