MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
CharType类 参考

固定长度的字符串类型 更多...

#include <char_type.h>

类 CharType 继承关系图:
DataType

Public 成员函数

int compare (const Value &left, const Value &right) const override
 
RC cast_to (const Value &val, AttrType type, Value &result) const override
 将 val 转换为 type 类型,并将结果保存到 result 中 更多...
 
RC set_value_from_str (Value &val, const string &data) const override
 
int cast_cost (AttrType type) override
 计算从 type 到 attr_type 的隐式转换的 cost,如果无法转换,返回 INT32_MAX 更多...
 
RC to_string (const Value &val, string &result) const override
 将 val 转换为 string,并将结果保存到 result 中 更多...
 
- Public 成员函数 继承自 DataType
 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 成员函数 继承自 DataType
static DataTypetype_instance (AttrType attr_type)
 
- Protected 属性 继承自 DataType
AttrType attr_type_
 
- 静态 Protected 属性 继承自 DataType
static array< unique_ptr< DataType >, static_cast< int >(AttrType::MAXTYPE)> type_instances_
 

详细描述

固定长度的字符串类型

成员函数说明

◆ cast_cost()

int CharType::cast_cost ( AttrType  type)
overridevirtual

计算从 type 到 attr_type 的隐式转换的 cost,如果无法转换,返回 INT32_MAX

重载 DataType .

◆ cast_to()

RC CharType::cast_to ( const Value val,
AttrType  type,
Value result 
) const
overridevirtual

将 val 转换为 type 类型,并将结果保存到 result 中

重载 DataType .

◆ compare()

int CharType::compare ( const Value left,
const Value right 
) const
overridevirtual
返回
-1 表示 left < right 0 表示 left = right 1 表示 left > right INT32_MAX 表示未实现的比较

重载 DataType .

◆ set_value_from_str()

RC CharType::set_value_from_str ( Value val,
const string &  data 
) const
overridevirtual

重载 DataType .

◆ to_string()

RC CharType::to_string ( const Value val,
string &  result 
) const
overridevirtual

将 val 转换为 string,并将结果保存到 result 中

重载 DataType .


该类的文档由以下文件生成: