MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
|
Public 成员函数 | |
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 |
静态 Public 成员函数 | |
static DataType * | type_instance (AttrType attr_type) |
Protected 属性 | |
AttrType | attr_type_ |
静态 Protected 属性 | |
static array< unique_ptr< DataType >, static_cast< int >(AttrType::MAXTYPE)> | type_instances_ |
|
inlinevirtual |
计算 left + right,并将结果保存到 result 中
被 FloatType, IntegerType , 以及 VectorType 重载.
|
inlinevirtual |
计算从 type 到 attr_type 的隐式转换的 cost,如果无法转换,返回 INT32_MAX
被 CharType 重载.
|
inlinevirtual |
将 val 转换为 type 类型,并将结果保存到 result 中
被 CharType 重载.
被 CharType, FloatType, IntegerType , 以及 VectorType 重载.
|
inlinevirtual |
计算 left / right,并将结果保存到 result 中
被 FloatType 重载.
|
inlinevirtual |
计算 left * right,并将结果保存到 result 中
被 FloatType, IntegerType , 以及 VectorType 重载.
计算 -val,并将结果保存到 result 中
被 FloatType , 以及 IntegerType 重载.
|
inlinevirtual |
计算 left - right,并将结果保存到 result 中
被 FloatType, IntegerType , 以及 VectorType 重载.
|
inlinevirtual |
将 val 转换为 string,并将结果保存到 result 中
被 CharType, FloatType, IntegerType , 以及 VectorType 重载.
|
staticprotected |