MiniOB 1
MiniOB is one mini database, helping developers to learn how database works.
载入中...
搜索中...
未找到
field_meta.h
1/* Copyright (c) 2021 OceanBase and/or its affiliates. All rights reserved.
2miniob is licensed under Mulan PSL v2.
3You can use this software according to the terms and conditions of the Mulan PSL v2.
4You may obtain a copy of Mulan PSL v2 at:
5 http://license.coscl.org.cn/MulanPSL2
6THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
7EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
8MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
9See the Mulan PSL v2 for more details. */
10
11//
12// Created by Meiyi & Wangyunlai on 2021/5/12.
13//
14
15#pragma once
16
17#include <string>
18
19#include "common/rc.h"
20#include "sql/parser/parse_defs.h"
21
22namespace Json {
23class Value;
24} // namespace Json
25
31{
32public:
33 FieldMeta();
34 FieldMeta(const char *name, AttrType attr_type, int attr_offset, int attr_len, bool visible);
35 ~FieldMeta() = default;
36
37 RC init(const char *name, AttrType attr_type, int attr_offset, int attr_len, bool visible);
38
39public:
40 const char *name() const;
41 AttrType type() const;
42 int offset() const;
43 int len() const;
44 bool visible() const;
45
46public:
47 void desc(std::ostream &os) const;
48
49public:
50 void to_json(Json::Value &json_value) const;
51 static RC from_json(const Json::Value &json_value, FieldMeta &field);
52
53protected:
54 std::string name_;
55 AttrType attr_type_;
56 int attr_offset_;
57 int attr_len_;
58 bool visible_;
59};
字段元数据
Definition: field_meta.h:31
属性的值
Definition: value.h:40