Kùzu C++ API
Loading...
Searching...
No Matches
local_table.h
Go to the documentation of this file.
1#pragma once
2
3#include <map>
4
5#include "table_type.h"
6#include "internal_id_t.h"
7#include "types.h"
8#include "table.h"
9
10namespace kuzu {
11namespace transaction {
12class Transaction;
13} // namespace transaction
14
15namespace storage {
16
17using offset_to_row_idx_t = std::map<common::offset_t, common::row_idx_t>;
18using offset_to_row_idx_vec_t = std::map<common::offset_t, std::vector<common::row_idx_t>>;
19using offset_set_t = std::unordered_set<common::offset_t>;
20
22struct TableInsertState;
23struct TableUpdateState;
24struct TableDeleteState;
26public:
27 virtual ~LocalTable() = default;
28
29 virtual bool insert(transaction::Transaction* transaction, TableInsertState& insertState) = 0;
30 virtual bool update(transaction::Transaction* transaction, TableUpdateState& updateState) = 0;
31 virtual bool delete_(transaction::Transaction* transaction, TableDeleteState& deleteState) = 0;
32 virtual bool addColumn(transaction::Transaction* transaction,
33 TableAddColumnState& addColumnState) = 0;
34 virtual void clear() = 0;
35 virtual common::TableType getTableType() const = 0;
36 virtual uint64_t getEstimatedMemUsage() = 0;
37
38 template<class TARGET>
42 template<class TARGET>
43 TARGET& cast() {
45 }
46 template<class TARGET>
47 TARGET* ptrCast() {
49 }
50 template<class TARGET>
51 const TARGET* ptrCast() const {
53 }
54
55protected:
56 explicit LocalTable(Table& table) : table{table} {}
57
58protected:
60};
61
62} // namespace storage
63} // namespace kuzu
Definition local_table.h:25
const TARGET * ptrCast() const
Definition local_table.h:51
TARGET & cast()
Definition local_table.h:43
virtual ~LocalTable()=default
TARGET * ptrCast()
Definition local_table.h:47
const TARGET & constCast()
Definition local_table.h:39
virtual bool addColumn(transaction::Transaction *transaction, TableAddColumnState &addColumnState)=0
LocalTable(Table &table)
Definition local_table.h:56
virtual bool update(transaction::Transaction *transaction, TableUpdateState &updateState)=0
Table & table
Definition local_table.h:59
virtual bool delete_(transaction::Transaction *transaction, TableDeleteState &deleteState)=0
virtual bool insert(transaction::Transaction *transaction, TableInsertState &insertState)=0
virtual common::TableType getTableType() const =0
virtual void clear()=0
virtual uint64_t getEstimatedMemUsage()=0
Definition table.h:134
Definition transaction.h:28
TO ku_dynamic_cast(FROM old)
Definition cast.h:11
TableType
Definition table_type.h:10
std::map< common::offset_t, common::row_idx_t > offset_to_row_idx_t
Definition local_table.h:17
std::unordered_set< common::offset_t > offset_set_t
Definition local_table.h:19
std::map< common::offset_t, std::vector< common::row_idx_t > > offset_to_row_idx_vec_t
Definition local_table.h:18
Definition alter_type.h:5
Definition table.h:109
Definition table.h:74
Definition table.h:91