userver: storages::clickhouse::io::FloatingWithPrecision< FloatingPointT, Precision, typename > Class Template Reference
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
storages::clickhouse::io::FloatingWithPrecision< FloatingPointT, Precision, typename > Class Template Reference

#include <userver/storages/clickhouse/io/floating_point_types.hpp>

Detailed Description

template<typename FloatingPointT, std::uint32_t Precision = std::is_same_v<FloatingPointT, float> ? 6 : 12, typename = std::enable_if_t<std::is_floating_point_v<FloatingPointT>>>
class storages::clickhouse::io::FloatingWithPrecision< FloatingPointT, Precision, typename >

Class that can be escaped for clickhouse queries instead of [double] and [float]. [double] and [float] are escaped as FloatingWithPrecision<double, 12> and FloatingWithPrecision<float, 6> respectively. These constants were derived from the accuracity the numbers from ranges [0.0-100000.0] (doubles) and [0.0-100.0] (floats) can be represented by these type. Clickhouse also supports inf, -inf and nan, see clickhouse docs.

Definition at line 21 of file floating_point_types.hpp.

Public Member Functions

template<typename U>
 FloatingWithPrecision (U value)
 
template<typename U, std::uint32_t AnotherPrecision>
 FloatingWithPrecision (const FloatingWithPrecision< U, AnotherPrecision > &other)
 
template<typename U, std::uint32_t AnotherPrecision>
 FloatingWithPrecision (FloatingWithPrecision< U, AnotherPrecision > &&other)
 
template<typename U, std::uint32_t AnotherPrecision>
FloatingWithPrecisionoperator= (const FloatingWithPrecision< U, AnotherPrecision > &other)
 
template<typename U, std::uint32_t AnotherPrecision>
FloatingWithPrecisionoperator= (FloatingWithPrecision< U, AnotherPrecision > &&other)
 
std::string ToString ()
 

Constructor & Destructor Documentation

◆ FloatingWithPrecision() [1/3]

template<typename FloatingPointT, std::uint32_t Precision = std::is_same_v<FloatingPointT, float> ? 6 : 12, typename = std::enable_if_t<std::is_floating_point_v<FloatingPointT>>>
template<typename U>
storages::clickhouse::io::FloatingWithPrecision< FloatingPointT, Precision, typename >::FloatingWithPrecision ( U value)
inline

Definition at line 24 of file floating_point_types.hpp.

◆ FloatingWithPrecision() [2/3]

template<typename FloatingPointT, std::uint32_t Precision = std::is_same_v<FloatingPointT, float> ? 6 : 12, typename = std::enable_if_t<std::is_floating_point_v<FloatingPointT>>>
template<typename U, std::uint32_t AnotherPrecision>
storages::clickhouse::io::FloatingWithPrecision< FloatingPointT, Precision, typename >::FloatingWithPrecision ( const FloatingWithPrecision< U, AnotherPrecision > & other)
inline

Definition at line 27 of file floating_point_types.hpp.

◆ FloatingWithPrecision() [3/3]

template<typename FloatingPointT, std::uint32_t Precision = std::is_same_v<FloatingPointT, float> ? 6 : 12, typename = std::enable_if_t<std::is_floating_point_v<FloatingPointT>>>
template<typename U, std::uint32_t AnotherPrecision>
storages::clickhouse::io::FloatingWithPrecision< FloatingPointT, Precision, typename >::FloatingWithPrecision ( FloatingWithPrecision< U, AnotherPrecision > && other)
inline

Definition at line 30 of file floating_point_types.hpp.

Member Function Documentation

◆ operator=() [1/2]

template<typename FloatingPointT, std::uint32_t Precision = std::is_same_v<FloatingPointT, float> ? 6 : 12, typename = std::enable_if_t<std::is_floating_point_v<FloatingPointT>>>
template<typename U, std::uint32_t AnotherPrecision>
FloatingWithPrecision & storages::clickhouse::io::FloatingWithPrecision< FloatingPointT, Precision, typename >::operator= ( const FloatingWithPrecision< U, AnotherPrecision > & other)
inline

Definition at line 33 of file floating_point_types.hpp.

◆ operator=() [2/2]

template<typename FloatingPointT, std::uint32_t Precision = std::is_same_v<FloatingPointT, float> ? 6 : 12, typename = std::enable_if_t<std::is_floating_point_v<FloatingPointT>>>
template<typename U, std::uint32_t AnotherPrecision>
FloatingWithPrecision & storages::clickhouse::io::FloatingWithPrecision< FloatingPointT, Precision, typename >::operator= ( FloatingWithPrecision< U, AnotherPrecision > && other)
inline

Definition at line 39 of file floating_point_types.hpp.

◆ ToString()

template<typename FloatingPointT, std::uint32_t Precision = std::is_same_v<FloatingPointT, float> ? 6 : 12, typename = std::enable_if_t<std::is_floating_point_v<FloatingPointT>>>
std::string storages::clickhouse::io::FloatingWithPrecision< FloatingPointT, Precision, typename >::ToString ( )
inline

Definition at line 47 of file floating_point_types.hpp.

Friends And Related Symbol Documentation

◆ FloatingWithPrecision

template<typename FloatingPointT, std::uint32_t Precision = std::is_same_v<FloatingPointT, float> ? 6 : 12, typename = std::enable_if_t<std::is_floating_point_v<FloatingPointT>>>
template<typename U, std::uint32_t AnotherPrecision, typename>
friend class FloatingWithPrecision
friend

Definition at line 53 of file floating_point_types.hpp.


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