mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Data Structures | Public Types | Public Member Functions | Protected Types
m::Table Struct Referenceabstract

A table is a sorted set of attributes. More...

#include <Schema.hpp>

Inheritance diagram for m::Table:
[legend]

Data Structures

struct  the_iterator
 

Public Types

using iterator = the_iterator< true, false >
 
using hidden_iterator = the_iterator< false, true >
 
using all_iterator = the_iterator< true, true >
 

Public Member Functions

virtual ~Table ()=default
 
virtual std::size_t num_attrs () const =0
 Returns the number of attributes in this table.
 
virtual std::size_t num_hidden_attrs () const =0
 
virtual std::size_t num_all_attrs () const =0
 
virtual iterator begin () const =0
 
virtual iterator end () const =0
 
virtual iterator cbegin () const =0
 
virtual iterator cend () const =0
 
virtual hidden_iterator begin_hidden () const =0
 
virtual hidden_iterator end_hidden () const =0
 
virtual hidden_iterator cbegin_hidden () const =0
 
virtual hidden_iterator cend_hidden () const =0
 
virtual all_iterator begin_all () const =0
 
virtual all_iterator end_all () const =0
 
virtual all_iterator cbegin_all () const =0
 
virtual all_iterator cend_all () const =0
 
virtual Attributeat (std::size_t id)=0
 Returns the attribute with the given id.
 
virtual const Attributeat (std::size_t id) const =0
 
virtual Attributeoperator[] (std::size_t id)=0
 Returns the attribute with the given id.
 
virtual const Attributeoperator[] (std::size_t id) const =0
 
virtual Attributeat (const ThreadSafePooledString &name)=0
 Returns the attribute with the given name.
 
virtual const Attributeat (const ThreadSafePooledString &name) const =0
 
virtual Attributeoperator[] (const ThreadSafePooledString &name)=0
 Returns the attribute with the given name.
 
virtual const Attributeoperator[] (const ThreadSafePooledString &name) const =0
 
virtual bool has_attribute (const ThreadSafePooledString &name) const =0
 Returns true iff the table has an attribute name.
 
virtual bool operator== (const Table &other)=0
 Returns true iff the Table other is the same as this, false otherwise.
 
virtual bool operator== (const Table &other) const =0
 
virtual const ThreadSafePooledStringname () const =0
 Returns the name of the Table.
 
virtual Storestore () const =0
 Returns a reference to the backing store.
 
virtual void store (std::unique_ptr< Store > new_store)=0
 Sets the backing store for this table.
 
virtual const storage::DataLayoutlayout () const =0
 Returns a reference to the physical data layout.
 
virtual void layout (storage::DataLayout &&new_layout)=0
 Sets the physical data layout for this table.
 
virtual void layout (const storage::DataLayoutFactory &factory)=0
 Sets the physical data layout for this table by calling factory.make().
 
virtual std::vector< std::reference_wrapper< const Attribute > > primary_key () const =0
 Returns all attributes forming the primary key.
 
virtual void add_primary_key (const ThreadSafePooledString &name)=0
 Adds an attribute with the given name to the primary key of this table.
 
virtual void push_back (ThreadSafePooledString name, const PrimitiveType *type)=0
 Adds a new attribute with the given name and type to the table.
 
virtual Schema schema (const ThreadSafePooledOptionalString &alias={}) const =0
 Returns a Schema for this Table given the alias alias.
 
virtual size_t convert_id (size_t id)=0
 Converts the id an non-hidden attribute would have in a table without any hidden attributes and returns the actual id of that attribute.
 
virtual void dump (std::ostream &out) const =0
 
virtual void dump () const =0
 

Protected Types

using table_type = std::vector< Attribute >
 

Detailed Description

A table is a sorted set of attributes.

Definition at line 387 of file Schema.hpp.

Member Typedef Documentation

◆ all_iterator

using m::Table::all_iterator = the_iterator<true, true>

Definition at line 524 of file Schema.hpp.

◆ hidden_iterator

Definition at line 523 of file Schema.hpp.

◆ iterator

using m::Table::iterator = the_iterator<true, false>

Definition at line 522 of file Schema.hpp.

◆ table_type

using m::Table::table_type = std::vector<Attribute>
protected

Definition at line 390 of file Schema.hpp.

Constructor & Destructor Documentation

◆ ~Table()

virtual m::Table::~Table ( )
virtualdefault

Member Function Documentation

◆ add_primary_key()

virtual void m::Table::add_primary_key ( const ThreadSafePooledString name)
pure virtual

Adds an attribute with the given name to the primary key of this table.

Throws std::out_of_range if no attribute with the given name exists.

Implemented in m::ConcreteTable, and m::TableDecorator.

◆ at() [1/4]

virtual const Attribute & m::Table::at ( const ThreadSafePooledString name) const
pure virtual

Implemented in m::ConcreteTable, and m::TableDecorator.

◆ at() [2/4]

virtual Attribute & m::Table::at ( const ThreadSafePooledString name)
pure virtual

Returns the attribute with the given name.

Throws std::out_of_range if no attribute with the given name exists.

Implemented in m::ConcreteTable, and m::TableDecorator.

◆ at() [3/4]

virtual const Attribute & m::Table::at ( std::size_t  id) const
pure virtual

Implemented in m::ConcreteTable, and m::TableDecorator.

◆ at() [4/4]

virtual Attribute & m::Table::at ( std::size_t  id)
pure virtual

Returns the attribute with the given id.

Throws std::out_of_range if no attribute with the given id exists.

Implemented in m::ConcreteTable, and m::TableDecorator.

Referenced by m::Database::get_table(), and m::DSVReader::operator()().

◆ begin()

virtual iterator m::Table::begin ( ) const
pure virtual

Implemented in m::ConcreteTable, and m::TableDecorator.

◆ begin_all()

virtual all_iterator m::Table::begin_all ( ) const
pure virtual

◆ begin_hidden()

virtual hidden_iterator m::Table::begin_hidden ( ) const
pure virtual

Implemented in m::ConcreteTable, and m::TableDecorator.

◆ cbegin()

virtual iterator m::Table::cbegin ( ) const
pure virtual

Implemented in m::ConcreteTable, and m::TableDecorator.

◆ cbegin_all()

virtual all_iterator m::Table::cbegin_all ( ) const
pure virtual

Implemented in m::ConcreteTable, and m::TableDecorator.

◆ cbegin_hidden()

virtual hidden_iterator m::Table::cbegin_hidden ( ) const
pure virtual

Implemented in m::ConcreteTable, and m::TableDecorator.

Referenced by m::DSVReader::operator()().

◆ cend()

virtual iterator m::Table::cend ( ) const
pure virtual

Implemented in m::ConcreteTable, and m::TableDecorator.

◆ cend_all()

virtual all_iterator m::Table::cend_all ( ) const
pure virtual

Implemented in m::ConcreteTable, and m::TableDecorator.

◆ cend_hidden()

virtual hidden_iterator m::Table::cend_hidden ( ) const
pure virtual

Implemented in m::ConcreteTable, and m::TableDecorator.

◆ convert_id()

virtual size_t m::Table::convert_id ( size_t  id)
pure virtual

Converts the id an non-hidden attribute would have in a table without any hidden attributes and returns the actual id of that attribute.

Implemented in m::ConcreteTable, and m::TableDecorator.

◆ dump() [1/2]

virtual void m::Table::dump ( ) const
pure virtual

◆ dump() [2/2]

virtual void m::Table::dump ( std::ostream &  out) const
pure virtual

◆ end()

virtual iterator m::Table::end ( ) const
pure virtual

Implemented in m::ConcreteTable, and m::TableDecorator.

◆ end_all()

virtual all_iterator m::Table::end_all ( ) const
pure virtual

◆ end_hidden()

virtual hidden_iterator m::Table::end_hidden ( ) const
pure virtual

Implemented in m::ConcreteTable, and m::TableDecorator.

Referenced by m::DSVReader::operator()().

◆ has_attribute()

virtual bool m::Table::has_attribute ( const ThreadSafePooledString name) const
pure virtual

Returns true iff the table has an attribute name.

Implemented in m::ConcreteTable, and m::TableDecorator.

◆ layout() [1/3]

virtual const storage::DataLayout & m::Table::layout ( ) const
pure virtual

Returns a reference to the physical data layout.

Implemented in m::ConcreteTable, and m::TableDecorator.

Referenced by m::CreateTable::execute(), m::WasmEngine::WasmContext::map_table(), and m::DSVReader::operator()().

◆ layout() [2/3]

virtual void m::Table::layout ( const storage::DataLayoutFactory factory)
pure virtual

Sets the physical data layout for this table by calling factory.make().

Implemented in m::ConcreteTable, and m::TableDecorator.

◆ layout() [3/3]

virtual void m::Table::layout ( storage::DataLayout &&  new_layout)
pure virtual

Sets the physical data layout for this table.

Implemented in m::ConcreteTable, and m::TableDecorator.

◆ name()

virtual const ThreadSafePooledString & m::Table::name ( ) const
pure virtual

◆ num_all_attrs()

virtual std::size_t m::Table::num_all_attrs ( ) const
pure virtual

Implemented in m::ConcreteTable, and m::TableDecorator.

◆ num_attrs()

virtual std::size_t m::Table::num_attrs ( ) const
pure virtual

Returns the number of attributes in this table.

Implemented in m::ConcreteTable, and m::TableDecorator.

Referenced by m::ColumnStore::ColumnStore(), m::PaxStore::compute_block_offsets(), and m::RowStore::compute_offsets().

◆ num_hidden_attrs()

virtual std::size_t m::Table::num_hidden_attrs ( ) const
pure virtual

Implemented in m::ConcreteTable, and m::TableDecorator.

◆ operator==() [1/2]

virtual bool m::Table::operator== ( const Table other) const
pure virtual

Implemented in m::ConcreteTable, and m::TableDecorator.

◆ operator==() [2/2]

virtual bool m::Table::operator== ( const Table other)
pure virtual

Returns true iff the Table other is the same as this, false otherwise.

Implemented in m::ConcreteTable, and m::TableDecorator.

◆ operator[]() [1/4]

virtual const Attribute & m::Table::operator[] ( const ThreadSafePooledString name) const
pure virtual

Implemented in m::ConcreteTable, and m::TableDecorator.

◆ operator[]() [2/4]

virtual Attribute & m::Table::operator[] ( const ThreadSafePooledString name)
pure virtual

Returns the attribute with the given name.

Implemented in m::ConcreteTable, and m::TableDecorator.

◆ operator[]() [3/4]

virtual const Attribute & m::Table::operator[] ( std::size_t  id) const
pure virtual

Implemented in m::ConcreteTable, and m::TableDecorator.

◆ operator[]() [4/4]

virtual Attribute & m::Table::operator[] ( std::size_t  id)
pure virtual

Returns the attribute with the given id.

Implemented in m::ConcreteTable, and m::TableDecorator.

◆ primary_key()

virtual std::vector< std::reference_wrapper< const Attribute > > m::Table::primary_key ( ) const
pure virtual

Returns all attributes forming the primary key.

Implemented in m::ConcreteTable, and m::TableDecorator.

◆ push_back()

virtual void m::Table::push_back ( ThreadSafePooledString  name,
const PrimitiveType type 
)
pure virtual

Adds a new attribute with the given name and type to the table.

Throws std::invalid_argument if the name is already in use.

Implemented in m::ConcreteTable, and m::TableDecorator.

Referenced by generate_training_suite_filter(), generate_training_suite_group_by(), and generate_training_suite_join().

◆ schema()

virtual Schema m::Table::schema ( const ThreadSafePooledOptionalString alias = {}) const
pure virtual

Returns a Schema for this Table given the alias alias.

Implemented in m::TableDecorator.

Referenced by m::ScanOperator::ScanOperator().

◆ store() [1/2]

virtual Store & m::Table::store ( ) const
pure virtual

Returns a reference to the backing store.

Implemented in m::ConcreteTable, and m::TableDecorator.

Referenced by m::CreateTable::execute(), m::WasmEngine::WasmContext::map_table(), and m::DSVReader::operator()().

◆ store() [2/2]

virtual void m::Table::store ( std::unique_ptr< Store new_store)
pure virtual

Sets the backing store for this table.

new_store must not be nullptr.

Implemented in m::ConcreteTable, and m::TableDecorator.


The documentation for this struct was generated from the following file: