mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Types | Protected Attributes
m::TableDecorator Struct Reference

Abstract Decorator class that concrete TableDecorator inherit from. More...

#include <Schema.hpp>

Inheritance diagram for m::TableDecorator:
[legend]
Collaboration diagram for m::TableDecorator:
[legend]

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

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

Protected Types

using table_type = std::vector< Attribute >
 

Protected Attributes

std::unique_ptr< Tabletable_
 

Detailed Description

Abstract Decorator class that concrete TableDecorator inherit from.

Definition at line 747 of file Schema.hpp.

Member Typedef Documentation

◆ all_iterator

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

Definition at line 524 of file Schema.hpp.

◆ hidden_iterator

using m::Table::hidden_iterator = the_iterator<false, true>
inherited

Definition at line 523 of file Schema.hpp.

◆ iterator

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

Definition at line 522 of file Schema.hpp.

◆ table_type

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

Definition at line 390 of file Schema.hpp.

Constructor & Destructor Documentation

◆ TableDecorator()

m::TableDecorator::TableDecorator ( std::unique_ptr< Table table)
inline

Definition at line 753 of file Schema.hpp.

◆ ~TableDecorator()

virtual m::TableDecorator::~TableDecorator ( )
virtualdefault

Member Function Documentation

◆ add_primary_key()

virtual void m::TableDecorator::add_primary_key ( const ThreadSafePooledString name)
inlineoverridevirtual

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.

Implements m::Table.

Definition at line 802 of file Schema.hpp.

References name(), and table_.

◆ at() [1/4]

virtual const Attribute & m::TableDecorator::at ( const ThreadSafePooledString name) const
inlineoverridevirtual

Implements m::Table.

Definition at line 782 of file Schema.hpp.

References name(), and table_.

◆ at() [2/4]

virtual Attribute & m::TableDecorator::at ( const ThreadSafePooledString name)
inlineoverridevirtual

Returns the attribute with the given name.

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

Implements m::Table.

Definition at line 781 of file Schema.hpp.

References name(), and table_.

◆ at() [3/4]

virtual const Attribute & m::TableDecorator::at ( std::size_t  id) const
inlineoverridevirtual

Implements m::Table.

Definition at line 776 of file Schema.hpp.

References table_.

◆ at() [4/4]

virtual Attribute & m::TableDecorator::at ( std::size_t  id)
inlineoverridevirtual

Returns the attribute with the given id.

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

Implements m::Table.

Definition at line 775 of file Schema.hpp.

References table_.

◆ begin()

virtual iterator m::TableDecorator::begin ( ) const
inlineoverridevirtual

Implements m::Table.

Definition at line 760 of file Schema.hpp.

References table_.

◆ begin_all()

virtual all_iterator m::TableDecorator::begin_all ( ) const
inlineoverridevirtual

Implements m::Table.

Definition at line 770 of file Schema.hpp.

References table_.

◆ begin_hidden()

virtual hidden_iterator m::TableDecorator::begin_hidden ( ) const
inlineoverridevirtual

Implements m::Table.

Definition at line 765 of file Schema.hpp.

References table_.

◆ cbegin()

virtual iterator m::TableDecorator::cbegin ( ) const
inlineoverridevirtual

Implements m::Table.

Definition at line 762 of file Schema.hpp.

References table_.

◆ cbegin_all()

virtual all_iterator m::TableDecorator::cbegin_all ( ) const
inlineoverridevirtual

Implements m::Table.

Definition at line 772 of file Schema.hpp.

References table_.

◆ cbegin_hidden()

virtual hidden_iterator m::TableDecorator::cbegin_hidden ( ) const
inlineoverridevirtual

Implements m::Table.

Definition at line 767 of file Schema.hpp.

References table_.

◆ cend()

virtual iterator m::TableDecorator::cend ( ) const
inlineoverridevirtual

Implements m::Table.

Definition at line 763 of file Schema.hpp.

References table_.

◆ cend_all()

virtual all_iterator m::TableDecorator::cend_all ( ) const
inlineoverridevirtual

Implements m::Table.

Definition at line 773 of file Schema.hpp.

References table_.

◆ cend_hidden()

virtual hidden_iterator m::TableDecorator::cend_hidden ( ) const
inlineoverridevirtual

Implements m::Table.

Definition at line 768 of file Schema.hpp.

References table_.

◆ convert_id()

virtual size_t m::TableDecorator::convert_id ( size_t  id)
inlineoverridevirtual

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

Implements m::Table.

Definition at line 808 of file Schema.hpp.

References table_.

◆ dump() [1/2]

virtual void m::TableDecorator::dump ( ) const
inlineoverridevirtual

Implements m::Table.

Reimplemented in m::MultiVersioningTable.

Definition at line 811 of file Schema.hpp.

References table_.

◆ dump() [2/2]

virtual void m::TableDecorator::dump ( std::ostream &  out) const
inlineoverridevirtual

Implements m::Table.

Reimplemented in m::MultiVersioningTable.

Definition at line 810 of file Schema.hpp.

References table_.

◆ end()

virtual iterator m::TableDecorator::end ( ) const
inlineoverridevirtual

Implements m::Table.

Definition at line 761 of file Schema.hpp.

References table_.

◆ end_all()

virtual all_iterator m::TableDecorator::end_all ( ) const
inlineoverridevirtual

Implements m::Table.

Definition at line 771 of file Schema.hpp.

References table_.

◆ end_hidden()

virtual hidden_iterator m::TableDecorator::end_hidden ( ) const
inlineoverridevirtual

Implements m::Table.

Definition at line 766 of file Schema.hpp.

References table_.

◆ has_attribute()

virtual bool m::TableDecorator::has_attribute ( const ThreadSafePooledString name) const
inlineoverridevirtual

Returns true iff the table has an attribute name.

Implements m::Table.

Definition at line 787 of file Schema.hpp.

References name(), and table_.

◆ layout() [1/3]

virtual const storage::DataLayout & m::TableDecorator::layout ( ) const
inlineoverridevirtual

Returns a reference to the physical data layout.

Implements m::Table.

Definition at line 797 of file Schema.hpp.

References table_.

◆ layout() [2/3]

virtual void m::TableDecorator::layout ( const storage::DataLayoutFactory factory)
inlineoverridevirtual

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

Implements m::Table.

Definition at line 799 of file Schema.hpp.

References table_.

◆ layout() [3/3]

virtual void m::TableDecorator::layout ( storage::DataLayout &&  new_layout)
inlineoverridevirtual

Sets the physical data layout for this table.

Implements m::Table.

Definition at line 798 of file Schema.hpp.

References table_.

◆ name()

virtual const ThreadSafePooledString & m::TableDecorator::name ( ) const
inlineoverridevirtual

Returns the name of the Table.

Implements m::Table.

Definition at line 792 of file Schema.hpp.

References table_.

Referenced by add_primary_key(), at(), has_attribute(), operator[](), and push_back().

◆ num_all_attrs()

virtual size_t m::TableDecorator::num_all_attrs ( ) const
inlineoverridevirtual

Implements m::Table.

Definition at line 758 of file Schema.hpp.

References table_.

◆ num_attrs()

virtual size_t m::TableDecorator::num_attrs ( ) const
inlineoverridevirtual

Returns the number of attributes in this table.

Implements m::Table.

Definition at line 756 of file Schema.hpp.

References table_.

◆ num_hidden_attrs()

virtual size_t m::TableDecorator::num_hidden_attrs ( ) const
inlineoverridevirtual

Implements m::Table.

Definition at line 757 of file Schema.hpp.

References table_.

◆ operator==() [1/2]

virtual bool m::TableDecorator::operator== ( const Table other) const
inlineoverridevirtual

Implements m::Table.

Definition at line 790 of file Schema.hpp.

◆ operator==() [2/2]

virtual bool m::TableDecorator::operator== ( const Table other)
inlineoverridevirtual

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

Implements m::Table.

Definition at line 789 of file Schema.hpp.

References table_.

◆ operator[]() [1/4]

virtual const Attribute & m::TableDecorator::operator[] ( const ThreadSafePooledString name) const
inlineoverridevirtual

Implements m::Table.

Definition at line 785 of file Schema.hpp.

References name(), and table_.

◆ operator[]() [2/4]

virtual Attribute & m::TableDecorator::operator[] ( const ThreadSafePooledString name)
inlineoverridevirtual

Returns the attribute with the given name.

Implements m::Table.

Definition at line 784 of file Schema.hpp.

References name(), and table_.

◆ operator[]() [3/4]

virtual const Attribute & m::TableDecorator::operator[] ( std::size_t  id) const
inlineoverridevirtual

Implements m::Table.

Definition at line 779 of file Schema.hpp.

References id, and table_.

◆ operator[]() [4/4]

virtual Attribute & m::TableDecorator::operator[] ( std::size_t  id)
inlineoverridevirtual

Returns the attribute with the given id.

Implements m::Table.

Definition at line 778 of file Schema.hpp.

References id, and table_.

◆ primary_key()

virtual std::vector< std::reference_wrapper< const Attribute > > m::TableDecorator::primary_key ( ) const
inlineoverridevirtual

Returns all attributes forming the primary key.

Implements m::Table.

Definition at line 801 of file Schema.hpp.

References table_.

◆ push_back()

virtual void m::TableDecorator::push_back ( ThreadSafePooledString  name,
const PrimitiveType type 
)
inlineoverridevirtual

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

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

Implements m::Table.

Definition at line 804 of file Schema.hpp.

References name(), and table_.

◆ schema()

virtual Schema m::TableDecorator::schema ( const ThreadSafePooledOptionalString alias) const
inlineoverridevirtual

Returns a Schema for this Table given the alias alias.

Implements m::Table.

Definition at line 806 of file Schema.hpp.

References table_.

◆ store() [1/2]

virtual Store & m::TableDecorator::store ( ) const
inlineoverridevirtual

Returns a reference to the backing store.

Implements m::Table.

Definition at line 794 of file Schema.hpp.

References table_.

◆ store() [2/2]

virtual void m::TableDecorator::store ( std::unique_ptr< Store new_store)
inlineoverridevirtual

Sets the backing store for this table.

new_store must not be nullptr.

Implements m::Table.

Definition at line 795 of file Schema.hpp.

References table_.

Field Documentation

◆ table_

std::unique_ptr<Table> m::TableDecorator::table_
protected

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