MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
|
浮点型数据类型 更多...
#include <float_type.h>
Public 成员函数 | |
int | compare (const Value &left, const Value &right) const override |
RC | add (const Value &left, const Value &right, Value &result) const override |
计算 left + right,并将结果保存到 result 中 更多... | |
RC | subtract (const Value &left, const Value &right, Value &result) const override |
计算 left - right,并将结果保存到 result 中 更多... | |
RC | multiply (const Value &left, const Value &right, Value &result) const override |
计算 left * right,并将结果保存到 result 中 更多... | |
RC | divide (const Value &left, const Value &right, Value &result) const override |
计算 left / right,并将结果保存到 result 中 更多... | |
RC | negative (const Value &val, Value &result) const override |
计算 -val,并将结果保存到 result 中 更多... | |
RC | set_value_from_str (Value &val, const string &data) const override |
RC | to_string (const Value &val, string &result) const override |
将 val 转换为 string,并将结果保存到 result 中 更多... | |
![]() | |
DataType (AttrType attr_type) | |
AttrType | get_attr_type () const |
virtual int | compare (const Value &left, const Value &right) const |
virtual RC | add (const Value &left, const Value &right, Value &result) const |
计算 left + right,并将结果保存到 result 中 更多... | |
virtual RC | subtract (const Value &left, const Value &right, Value &result) const |
计算 left - right,并将结果保存到 result 中 更多... | |
virtual RC | multiply (const Value &left, const Value &right, Value &result) const |
计算 left * right,并将结果保存到 result 中 更多... | |
virtual RC | divide (const Value &left, const Value &right, Value &result) const |
计算 left / right,并将结果保存到 result 中 更多... | |
virtual RC | negative (const Value &val, Value &result) const |
计算 -val,并将结果保存到 result 中 更多... | |
virtual RC | cast_to (const Value &val, AttrType type, Value &result) const |
将 val 转换为 type 类型,并将结果保存到 result 中 更多... | |
virtual RC | to_string (const Value &val, string &result) const |
将 val 转换为 string,并将结果保存到 result 中 更多... | |
virtual int | cast_cost (AttrType type) |
计算从 type 到 attr_type 的隐式转换的 cost,如果无法转换,返回 INT32_MAX 更多... | |
virtual RC | set_value_from_str (Value &val, const string &data) const |
额外继承的成员函数 | |
![]() | |
static DataType * | type_instance (AttrType attr_type) |
![]() | |
AttrType | attr_type_ |
![]() | |
static array< unique_ptr< DataType >, static_cast< int >(AttrType::MAXTYPE)> | type_instances_ |
浮点型数据类型
计算 left + right,并将结果保存到 result 中
重载 DataType .
重载 DataType .
|
overridevirtual |
计算 left / right,并将结果保存到 result 中
重载 DataType .
|
overridevirtual |
计算 left * right,并将结果保存到 result 中
重载 DataType .
计算 -val,并将结果保存到 result 中
重载 DataType .
|
overridevirtual |
重载 DataType .
|
overridevirtual |
计算 left - right,并将结果保存到 result 中
重载 DataType .
|
overridevirtual |
将 val 转换为 string,并将结果保存到 result 中
重载 DataType .