#pragma once #include "storage/common/table.h" #include "storage/common/field_meta.h" class Field { public: Field() = default; Field(const Table *table, const FieldMeta *field) : table_(table), field_(field) {} const Table *table() const { return table_; } const FieldMeta *meta() const { return field_; } AttrType attr_type() const { return field_->type(); } const char *table_name() const { return table_->name(); } const char *field_name() const { return field_->name(); } void set_table(const Table *table) { this->table_ = table; } void set_field(const FieldMeta *field) { this->field_ = field; } private: const Table *table_ = nullptr; const FieldMeta *field_ = nullptr; };