MySQL 8.4.2
Source Code Documentation
my_decimal Class Reference

my_decimal class limits 'decimal_t' type to what we need in MySQL. More...

#include <my_decimal.h>

Inheritance diagram for my_decimal:
[legend]

Public Member Functions

 my_decimal (const my_decimal &rhs)
 
my_decimaloperator= (const my_decimal &rhs)
 
void init ()
 
 my_decimal ()
 
 ~my_decimal ()
 
void sanity_check () const
 
bool sign () const
 
void sign (bool s)
 
uint precision () const
 
void swap (my_decimal &rhs)
 Swap two my_decimal values. More...
 
int check_result (uint, int result) const
 report result of decimal operation. More...
 

Private Attributes

int foo1
 
decimal_digit_t buffer [DECIMAL_BUFF_LENGTH]
 
int foo2
 

Static Private Attributes

static const int test_value = 123
 

Additional Inherited Members

- Public Attributes inherited from decimal_t
int intg
 
int frac
 
int len
 
bool sign
 
decimal_digit_tbuf
 

Detailed Description

my_decimal class limits 'decimal_t' type to what we need in MySQL.

It contains internally all necessary space needed by the instance so no extra memory is needed. Objects should be moved using copy CTOR or assignment operator, rather than memcpy/memmove.

Constructor & Destructor Documentation

◆ my_decimal() [1/2]

my_decimal::my_decimal ( const my_decimal rhs)
inline

◆ my_decimal() [2/2]

my_decimal::my_decimal ( )
inline

◆ ~my_decimal()

my_decimal::~my_decimal ( )
inline

Member Function Documentation

◆ check_result()

int my_decimal::check_result ( uint  mask,
int  result 
) const

report result of decimal operation.

Parameters
maskbitmask filtering result, most likely E_DEC_FATAL_ERROR
resultdecimal library return code (E_DEC_* see include/decimal.h)
Returns
result

◆ init()

void my_decimal::init ( )
inline

◆ operator=()

my_decimal & my_decimal::operator= ( const my_decimal rhs)
inline

◆ precision()

uint my_decimal::precision ( ) const
inline

◆ sanity_check()

void my_decimal::sanity_check ( ) const
inline

◆ sign() [1/2]

bool my_decimal::sign ( ) const
inline

◆ sign() [2/2]

void my_decimal::sign ( bool  s)
inline

◆ swap()

void my_decimal::swap ( my_decimal rhs)
inline

Swap two my_decimal values.

Member Data Documentation

◆ buffer

decimal_digit_t my_decimal::buffer[DECIMAL_BUFF_LENGTH]
private

◆ foo1

int my_decimal::foo1
private

◆ foo2

int my_decimal::foo2
private

◆ test_value

const int my_decimal::test_value = 123
staticprivate

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