mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Store.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <iostream>
4#include <memory>
5#include <mutable/mutable-config.hpp>
8#include <string>
9#include <unordered_map>
10
11
12namespace m {
13
14/*----- forward declarations -----------------------------------------------------------------------------------------*/
15struct Attribute;
16struct Schema;
17struct StackMachine;
18struct Table;
19
21struct M_EXPORT Store
22{
23 private:
24 const Table &table_;
25
26 protected:
27 Store(const Table &table) : table_(table) {}
28
29 public:
30 Store(const Store &) = delete;
31
32 Store(Store &&) = default;
33
34 virtual ~Store() {}
35
36 const Table &table() const { return table_; }
37
39 virtual const memory::Memory & memory() const = 0;
40
42 virtual std::size_t num_rows() const = 0;
43
45 virtual void append() = 0;
46
48 virtual void drop() = 0;
49
50 virtual void dump(std::ostream &out) const = 0;
51 void dump() const;
52};
53
54}
‍mutable namespace
Definition: Backend.hpp:10
Defines a generic store interface.
Definition: Store.hpp:22
virtual ~Store()
Definition: Store.hpp:34
virtual const memory::Memory & memory() const =0
Returns the memory corresponding to the Linearization's root node.
virtual std::size_t num_rows() const =0
Return the number of rows in this store.
const Table & table_
the table defining this store's schema
Definition: Store.hpp:24
virtual void dump(std::ostream &out) const =0
virtual void append()=0
Append a row to the store.
const Table & table() const
Definition: Store.hpp:36
virtual void drop()=0
Drop the most recently appended row.
Store(const Table &table)
Definition: Store.hpp:27
Store(const Store &)=delete
Store(Store &&)=default
A table is a sorted set of attributes.
Definition: Schema.hpp:388
Represents a mapping created by a memory::Allocator.
Definition: memory.hpp:78