userver: storages::odbc::Decimal< Precision, Scale > Class Template Reference
Loading...
Searching...
No Matches
storages::odbc::Decimal< Precision, Scale > Class Template Referencefinal

#include </data/code/userver/odbc/include/userver/storages/odbc/types.hpp>

Detailed Description

template<std::size_t Precision, std::size_t Scale>
class storages::odbc::Decimal< Precision, Scale >

Exact fixed-point SQL DECIMAL/NUMERIC value.

Accepted syntax is [-+]digits for Scale=0 and [-+]digits.Scale-digits otherwise. Exponents, whitespace, NaN and infinities are rejected. Values are canonicalized by removing a leading plus and redundant integer zeroes; negative zero is normalized to positive zero. Exactly Scale fractional digits, including trailing zeroes, are retained. ODBC SQL_NUMERIC_STRUCT limits portable precision to 38 digits.

Definition at line 118 of file types.hpp.

Public Member Functions

 Decimal (std::string_view representation)
std::string_view GetRepresentation () const noexcept
bool operator== (const Decimal &) const noexcept=default

Static Public Member Functions

static constexpr std::size_t GetPrecision () noexcept
static constexpr std::size_t GetScale () noexcept

Static Public Attributes

static constexpr std::size_t kPrecision = Precision
static constexpr std::size_t kScale = Scale

Constructor & Destructor Documentation

◆ Decimal() [1/2]

template<std::size_t Precision, std::size_t Scale>
storages::odbc::Decimal< Precision, Scale >::Decimal ( )
inline

Definition at line 126 of file types.hpp.

◆ Decimal() [2/2]

template<std::size_t Precision, std::size_t Scale>
storages::odbc::Decimal< Precision, Scale >::Decimal ( std::string_view representation)
inlineexplicit

Definition at line 130 of file types.hpp.

Member Function Documentation

◆ GetPrecision()

template<std::size_t Precision, std::size_t Scale>
constexpr std::size_t storages::odbc::Decimal< Precision, Scale >::GetPrecision ( )
inlinestaticconstexprnoexcept

Definition at line 135 of file types.hpp.

◆ GetRepresentation()

template<std::size_t Precision, std::size_t Scale>
std::string_view storages::odbc::Decimal< Precision, Scale >::GetRepresentation ( ) const
noexcept

Definition at line 163 of file types.hpp.

◆ GetScale()

template<std::size_t Precision, std::size_t Scale>
constexpr std::size_t storages::odbc::Decimal< Precision, Scale >::GetScale ( )
inlinestaticconstexprnoexcept

Definition at line 136 of file types.hpp.

Member Data Documentation

◆ kPrecision

template<std::size_t Precision, std::size_t Scale>
std::size_t storages::odbc::Decimal< Precision, Scale >::kPrecision = Precision
staticconstexpr

Definition at line 123 of file types.hpp.

◆ kScale

template<std::size_t Precision, std::size_t Scale>
std::size_t storages::odbc::Decimal< Precision, Scale >::kScale = Scale
staticconstexpr

Definition at line 124 of file types.hpp.


The documentation for this class was generated from the following file:
  • /data/code/userver/odbc/include/userver/storages/odbc/types.hpp