drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
drizzled::type::Decimal Class Reference

#include <decimal.h>

Inheritance diagram for drizzled::type::Decimal:
[legend]
Collaboration diagram for drizzled::type::Decimal:
[legend]

Public Member Functions

void init ()
void fix_buffer_pointer ()
bool sign () const
void sign (bool s)
uint32_t precision () const
int val_int32 (uint32_t mask, bool unsigned_flag, int64_t *l) const
int string_length () const
int val_binary (uint32_t mask, unsigned char *bin, int prec, int scale) const
int store (uint32_t mask, const char *from, uint32_t length, const charset_info_st *charset)
 Convert string for decimal when string can be in some multibyte charset.
int store (uint32_t mask, char *str, char **end)
int store (uint32_t mask, const String *str)
int check_result_and_overflow (uint32_t mask, int result)
void convert (double &value) const
Public Member Functions inherited from drizzled::decimal_t
void set_zero ()
void negate ()
int isZero () const

Private Attributes

decimal_digit_t buffer [DECIMAL_BUFF_LENGTH]

Additional Inherited Members

Public Attributes inherited from drizzled::decimal_t
int intg
int frac
int len
bool sign
decimal_digit_t * buf

Detailed Description

type 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. One should call fix_buffer_pointer() function when he moves type::Decimal objects in memory.

Definition at line 183 of file type/decimal.h.

Constructor & Destructor Documentation

◆ Decimal()

drizzled::type::Decimal::Decimal ( )
inline

Definition at line 200 of file type/decimal.h.

Member Function Documentation

◆ check_result_and_overflow()

int drizzled::type::Decimal::check_result_and_overflow ( uint32_t mask,
int result )
inline

Definition at line 239 of file type/decimal.h.

◆ convert()

void drizzled::type::Decimal::convert ( double & value) const

Definition at line 314 of file type/decimal.cc.

◆ fix_buffer_pointer()

void drizzled::type::Decimal::fix_buffer_pointer ( )
inline

Definition at line 205 of file type/decimal.h.

◆ init()

void drizzled::type::Decimal::init ( )
inline

Definition at line 189 of file type/decimal.h.

◆ precision()

uint32_t drizzled::type::Decimal::precision ( ) const
inline

Definition at line 208 of file type/decimal.h.

◆ sign() [1/2]

bool drizzled::type::Decimal::sign ( ) const
inline

Definition at line 206 of file type/decimal.h.

◆ sign() [2/2]

void drizzled::type::Decimal::sign ( bool s)
inline

Definition at line 207 of file type/decimal.h.

◆ store() [1/3]

int drizzled::type::Decimal::store ( uint32_t mask,
char * str,
char ** end )
inline

Definition at line 229 of file type/decimal.h.

◆ store() [2/3]

int drizzled::type::Decimal::store ( uint32_t mask,
const char * from,
uint32_t length,
const charset_info_st * charset )

Convert string for decimal when string can be in some multibyte charset.

Parameters
maskerror processing mask
fromstring to process
lengthlength of given string
charsetcharset of given string
Returns
Error code
Return values
E_DEC_OK
E_DEC_TRUNCATED
E_DEC_OVERFLOW
E_DEC_BAD_NUM
E_DEC_OOM

Definition at line 283 of file type/decimal.cc.

◆ store() [3/3]

int drizzled::type::Decimal::store ( uint32_t mask,
const String * str )
inline

Definition at line 234 of file type/decimal.h.

◆ string_length()

int drizzled::type::Decimal::string_length ( ) const
inline

Definition at line 220 of file type/decimal.h.

◆ val_binary()

int drizzled::type::Decimal::val_binary ( uint32_t mask,
unsigned char * bin,
int prec,
int scale ) const

Definition at line 246 of file type/decimal.cc.

◆ val_int32()

int drizzled::type::Decimal::val_int32 ( uint32_t mask,
bool unsigned_flag,
int64_t * l ) const
inline

Definition at line 210 of file type/decimal.h.

Member Data Documentation

◆ buffer

decimal_digit_t drizzled::type::Decimal::buffer[DECIMAL_BUFF_LENGTH]
private

Definition at line 185 of file type/decimal.h.


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