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

属性的值 更多...

#include <value.h>

Public 成员函数

 Value (AttrType attr_type, char *data, int length=4)
 
 Value (int val)
 
 Value (float val)
 
 Value (bool val)
 
 Value (const char *s, int len=0)
 
 Value (const Value &other)=default
 
Valueoperator= (const Value &other)=default
 
void set_type (AttrType type)
 
void set_data (char *data, int length)
 
void set_data (const char *data, int length)
 
void set_int (int val)
 
void set_float (float val)
 
void set_boolean (bool val)
 
void set_string (const char *s, int len=0)
 
void set_value (const Value &value)
 
std::string to_string () const
 
int compare (const Value &other) const
 
const char * data () const
 
int length () const
 
AttrType attr_type () const
 
int get_int () const
 
float get_float () const
 
std::string get_string () const
 
bool get_boolean () const
 

Private 属性

AttrType attr_type_ = UNDEFINED
 
int length_ = 0
 
union {
   int   int_value_
 
   float   float_value_
 
   bool   bool_value_
 
num_value_
 
std::string str_value_
 

详细描述

属性的值

成员函数说明

◆ get_int()

int Value::get_int ( ) const

获取对应的值 如果当前的类型与期望获取的类型不符,就会执行转换操作


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