|
MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
|
属性的值 更多...
#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 | |
| Value & | operator= (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_ |
属性的值
| int Value::get_int | ( | ) | const |
获取对应的值 如果当前的类型与期望获取的类型不符,就会执行转换操作