mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Friends
m::wasm::Decimal< Base > Struct Template Reference

#include <WasmUtil.hpp>

Inheritance diagram for m::wasm::Decimal< Base >:
[legend]
Collaboration diagram for m::wasm::Decimal< Base >:
[legend]

Public Types

using expr_type = Expr< Base >
 
using arithmetic_type = Base
 

Public Member Functions

 Decimal (Base value, uint32_t scale)
 Constructs a Decimal from a given value at the given scale.
 
 Decimal (expr_type value, uint32_t scale)
 Constructs a Decimal from a given value at the given scale.
 
 Decimal (Decimal &other)
 
 Decimal (Decimal &&other)
 
expr_type val ()
 
uint32_t scale () const
 
template<signed_integral To>
Expr< Toto ()
 
Decimal clone () const
 
Decimal operator~ ()
 Bitwise negation is not supported by Decimal type.
 
Decimal operator+ (Decimal other)
 
template<typename T >
requires expr_convertible<T>
and signed_integral< typename expr_t< T >::type > Decimal operator+ (T &&other)
 
Decimal operator- (Decimal other)
 
template<typename T >
requires expr_convertible<T>
and signed_integral< typename expr_t< T >::type > Decimal operator- (T &&other)
 
Decimal operator* (Decimal other)
 
template<typename T >
requires expr_convertible<T>
and signed_integral< typename expr_t< T >::type > Decimal operator* (T &&other)
 
Decimal operator/ (Decimal other)
 
template<typename T >
requires expr_convertible<T>
and signed_integral< typename expr_t< T >::type > Decimal operator/ (T &&other)
 
template<typename T >
requires false
Decimal operator% (T &&)
 Modulo division is not supported by Decimal type.
 
template<typename T >
requires false
Decimal operator bitand (T &&)
 Bitwise and is not supported by Decimal type.
 
template<typename T >
requires false
Decimal operator bitor (T &&)
 Bitwise or is not supported by Decimal type.
 
template<typename T >
requires false
Decimal operator xor (T &&)
 Bitwise xor (exclusive or) is not supported by Decimal type.
 
template<typename T >
requires false
Decimal operator<< (T &&)
 Shift left is not supported by Decimal type.
 
template<typename T >
requires false
Decimal operator>> (T &&)
 Shift right is not supported by Decimal type.
 
template<typename T >
requires false
Decimal rotl (T &&)
 Shift right is not supported by Decimal type.
 
template<typename T >
requires false
Decimal rotr (T &&)
 Shift right is not supported by Decimal type.
 
void dump (std::ostream &out) const
 
void dump () const
 

Static Public Member Functions

static Decimal Scaled (expr_type value, uint32_t scale)
 Constructs a Decimal from a given value at the given scale.
 

Private Attributes

uint32_t scale_
 

‍the number of decimal digits right of the decimal point


 

Friends

std::ostream & operator<< (std::ostream &out, const Decimal &d)
 

Detailed Description

template<signed_integral Base>
struct m::wasm::Decimal< Base >

Definition at line 92 of file WasmUtil.hpp.

Member Typedef Documentation

◆ arithmetic_type

template<signed_integral Base>
using m::wasm::Decimal< Base >::arithmetic_type = Base

Definition at line 95 of file WasmUtil.hpp.

◆ expr_type

template<signed_integral Base>
using m::wasm::Decimal< Base >::expr_type = Expr<Base>

Definition at line 94 of file WasmUtil.hpp.

Constructor & Destructor Documentation

◆ Decimal() [1/4]

template<signed_integral Base>
m::wasm::Decimal< Base >::Decimal ( Base  value,
uint32_t  scale 
)
inline

Constructs a Decimal from a given value at the given scale.

For example, a value of 142 at a scale of 2 would represent 1.42.

Definition at line 104 of file WasmUtil.hpp.

References M_insist, and m::wasm::Decimal< Base >::scale().

◆ Decimal() [2/4]

template<signed_integral Base>
m::wasm::Decimal< Base >::Decimal ( expr_type  value,
uint32_t  scale 
)
inline

Constructs a Decimal from a given value at the given scale.

For example, a value of 142 at a scale of 2 would represent 1.42.

Definition at line 110 of file WasmUtil.hpp.

◆ Decimal() [3/4]

template<signed_integral Base>
m::wasm::Decimal< Base >::Decimal ( Decimal< Base > &  other)
inline

Definition at line 112 of file WasmUtil.hpp.

◆ Decimal() [4/4]

template<signed_integral Base>
m::wasm::Decimal< Base >::Decimal ( Decimal< Base > &&  other)
inline

Definition at line 113 of file WasmUtil.hpp.

Member Function Documentation

◆ clone()

template<signed_integral Base>
Decimal m::wasm::Decimal< Base >::clone ( ) const
inline

Definition at line 131 of file WasmUtil.hpp.

References m::wasm::Decimal< Base >::scale_.

◆ dump() [1/2]

template<signed_integral Base>
void m::wasm::Decimal< Base >::dump ( ) const
inline

Definition at line 252 of file WasmUtil.hpp.

References m::wasm::Decimal< Base >::dump().

Referenced by m::wasm::Decimal< Base >::dump().

◆ dump() [2/2]

template<signed_integral Base>
void m::wasm::Decimal< Base >::dump ( std::ostream &  out) const
inline

Definition at line 251 of file WasmUtil.hpp.

◆ operator bitand()

template<signed_integral Base>
template<typename T >
requires false
Decimal m::wasm::Decimal< Base >::operator bitand ( T &&  )
inline

Bitwise and is not supported by Decimal type.

Definition at line 214 of file WasmUtil.hpp.

References M_unreachable.

◆ operator bitor()

template<signed_integral Base>
template<typename T >
requires false
Decimal m::wasm::Decimal< Base >::operator bitor ( T &&  )
inline

Bitwise or is not supported by Decimal type.

Definition at line 219 of file WasmUtil.hpp.

References M_unreachable.

◆ operator xor()

template<signed_integral Base>
template<typename T >
requires false
Decimal m::wasm::Decimal< Base >::operator xor ( T &&  )
inline

Bitwise xor (exclusive or) is not supported by Decimal type.

Definition at line 224 of file WasmUtil.hpp.

References M_unreachable.

◆ operator%()

template<signed_integral Base>
template<typename T >
requires false
Decimal m::wasm::Decimal< Base >::operator% ( T &&  )
inline

Modulo division is not supported by Decimal type.

Definition at line 209 of file WasmUtil.hpp.

References M_unreachable.

◆ operator*() [1/2]

template<signed_integral Base>
Decimal m::wasm::Decimal< Base >::operator* ( Decimal< Base >  other)
inline

◆ operator*() [2/2]

template<signed_integral Base>
template<typename T >
requires expr_convertible<T>
and signed_integral< typename expr_t< T >::type > Decimal m::wasm::Decimal< Base >::operator* ( T &&  other)
inline

◆ operator+() [1/2]

template<signed_integral Base>
Decimal m::wasm::Decimal< Base >::operator+ ( Decimal< Base >  other)
inline

◆ operator+() [2/2]

template<signed_integral Base>
template<typename T >
requires expr_convertible<T>
and signed_integral< typename expr_t< T >::type > Decimal m::wasm::Decimal< Base >::operator+ ( T &&  other)
inline

◆ operator-() [1/2]

template<signed_integral Base>
Decimal m::wasm::Decimal< Base >::operator- ( Decimal< Base >  other)
inline

◆ operator-() [2/2]

template<signed_integral Base>
template<typename T >
requires expr_convertible<T>
and signed_integral< typename expr_t< T >::type > Decimal m::wasm::Decimal< Base >::operator- ( T &&  other)
inline

◆ operator/() [1/2]

template<signed_integral Base>
Decimal m::wasm::Decimal< Base >::operator/ ( Decimal< Base >  other)
inline

◆ operator/() [2/2]

template<signed_integral Base>
template<typename T >
requires expr_convertible<T>
and signed_integral< typename expr_t< T >::type > Decimal m::wasm::Decimal< Base >::operator/ ( T &&  other)
inline

◆ operator<<()

template<signed_integral Base>
template<typename T >
requires false
Decimal m::wasm::Decimal< Base >::operator<< ( T &&  )
inline

Shift left is not supported by Decimal type.

Definition at line 229 of file WasmUtil.hpp.

References M_unreachable.

◆ operator>>()

template<signed_integral Base>
template<typename T >
requires false
Decimal m::wasm::Decimal< Base >::operator>> ( T &&  )
inline

Shift right is not supported by Decimal type.

Definition at line 234 of file WasmUtil.hpp.

References M_unreachable.

◆ operator~()

template<signed_integral Base>
Decimal m::wasm::Decimal< Base >::operator~ ( )
inline

Bitwise negation is not supported by Decimal type.

Definition at line 139 of file WasmUtil.hpp.

References M_unreachable.

◆ rotl()

template<signed_integral Base>
template<typename T >
requires false
Decimal m::wasm::Decimal< Base >::rotl ( T &&  )
inline

Shift right is not supported by Decimal type.

Definition at line 239 of file WasmUtil.hpp.

References M_unreachable.

◆ rotr()

template<signed_integral Base>
template<typename T >
requires false
Decimal m::wasm::Decimal< Base >::rotr ( T &&  )
inline

Shift right is not supported by Decimal type.

Definition at line 244 of file WasmUtil.hpp.

References M_unreachable.

◆ scale()

template<signed_integral Base>
uint32_t m::wasm::Decimal< Base >::scale ( ) const
inline

◆ Scaled()

template<signed_integral Base>
static Decimal m::wasm::Decimal< Base >::Scaled ( expr_type  value,
uint32_t  scale 
)
inlinestatic

Constructs a Decimal from a given value at the given scale.

For example, a value of 142 at a scale of 2 would represent 142.00.

Definition at line 117 of file WasmUtil.hpp.

References m::powi(), m::wasm::Decimal< Base >::scale(), and m::wasm::value.

Referenced by m::wasm::Decimal< Base >::operator+(), and m::wasm::Decimal< Base >::operator-().

◆ to()

template<signed_integral Base>
template<signed_integral To>
Expr< To > m::wasm::Decimal< Base >::to ( )
inline

◆ val()

template<signed_integral Base>
expr_type m::wasm::Decimal< Base >::val ( )
inline

Friends And Related Function Documentation

◆ operator<<

template<signed_integral Base>
std::ostream & operator<< ( std::ostream &  out,
const Decimal< Base > &  d 
)
friend

Definition at line 247 of file WasmUtil.hpp.

Field Documentation

◆ scale_

template<signed_integral Base>
uint32_t m::wasm::Decimal< Base >::scale_
private

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