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

A column contains multiple values in contiguous memory with a specified type. 更多...

#include <column.h>

Public 类型

enum class  Type { NORMAL_COLUMN , CONSTANT_COLUMN }
 

Public 成员函数

 Column (const Column &)=delete
 
 Column (Column &&)=delete
 
 Column (const FieldMeta &meta, size_t size=DEFAULT_CAPACITY)
 
 Column (AttrType attr_type, int attr_len, size_t size=DEFAULT_CAPACITY)
 
void init (const FieldMeta &meta, size_t size=DEFAULT_CAPACITY)
 
void init (AttrType attr_type, int attr_len, size_t size=DEFAULT_CAPACITY)
 
void init (const Value &value)
 
void reset ()
 
RC append_one (char *data)
 
RC append (char *data, int count)
 Column 追加写入数据 更多...
 
Value get_value (int index) const
 获取 index 位置的列值
 
int data_len () const
 获取列数据的实际大小(字节)
 
char * data () const
 
void reset_data ()
 重置列数据,但不修改元信息
 
void reference (const Column &column)
 引用另一个 Column
 
void set_column_type (Type column_type)
 
void set_count (int count)
 
int count () const
 
int capacity () const
 
AttrType attr_type () const
 
int attr_len () const
 
Type column_type () const
 

Private 属性

char * data_ = nullptr
 
int count_ = 0
 当前列值数量
 
int capacity_ = 0
 当前容量,count_ <= capacity_
 
bool own_ = true
 是否拥有内存
 
AttrType attr_type_ = AttrType::UNDEFINED
 列属性类型
 
int attr_len_ = -1
 列属性类型长度(目前只支持定长)
 
Type column_type_ = Type::NORMAL_COLUMN
 列类型
 

静态 Private 属性

static constexpr size_t DEFAULT_CAPACITY = 8192
 

详细描述

A column contains multiple values in contiguous memory with a specified type.

成员枚举类型说明

◆ Type

enum class Column::Type
strong
枚举值
CONSTANT_COLUMN 

Normal column represents a list of fixed-length values

Constant column represents a single value

成员函数说明

◆ append()

RC Column::append ( char *  data,
int  count 
)

Column 追加写入数据

参数
data要被写入数据的起始地址
count要写入数据的长度(这里指列值的个数,而不是字节)

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