![]() |
mutable
A Database System for Research and Fast Prototyping
|
Basic implementation of Table
.
More...
#include <Schema.hpp>
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 | |
ConcreteTable (ThreadSafePooledString name) | |
virtual | ~ConcreteTable ()=default |
std::size_t | num_attrs () const override |
Returns the number of non-hidden attributes in this table. | |
std::size_t | num_hidden_attrs () const override |
Returns the number of hidden attributes in this table. | |
std::size_t | num_all_attrs () const override |
Returns the number of attributes in this table. | |
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 |
Attribute & | at (std::size_t id) override |
Returns the attribute with the given id . | |
const Attribute & | at (std::size_t id) const override |
Attribute & | operator[] (std::size_t id) override |
Returns the attribute with the given id . | |
const Attribute & | operator[] (std::size_t id) const override |
Attribute & | at (const ThreadSafePooledString &name) override |
Returns the attribute with the given name . | |
const Attribute & | at (const ThreadSafePooledString &name) const override |
Attribute & | operator[] (const ThreadSafePooledString &name) override |
Returns the attribute with the given name . | |
const Attribute & | operator[] (const ThreadSafePooledString &name) const override |
bool | has_attribute (const ThreadSafePooledString &name) const override |
Returns true iff the table has an attribute name . | |
bool | operator== (const Table &other) override |
Returns true iff the Table other is the same as this , false otherwise. | |
bool | operator== (const Table &other) const override |
const ThreadSafePooledString & | name () const override |
Returns the name of the Table. | |
Store & | store () const override |
Returns a reference to the backing store. | |
void | store (std::unique_ptr< Store > new_store) override |
Sets the backing store for this table. | |
const storage::DataLayout & | layout () const override |
Returns a reference to the physical data layout. | |
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() . | |
std::vector< std::reference_wrapper< const Attribute > > | primary_key () const override |
Returns all attributes forming the primary key. | |
void | add_primary_key (const ThreadSafePooledString &name) override |
Adds an attribute with the given name to the primary key of this table. | |
void | push_back (ThreadSafePooledString name, const PrimitiveType *type) override |
Adds a new attribute with the given name and type to the table. | |
Schema | schema (const ThreadSafePooledOptionalString &alias={}) const override |
Returns a Schema for this Table given the alias alias . | |
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 |
virtual Schema | schema (const ThreadSafePooledOptionalString &alias={}) const =0 |
Returns a Schema for this Table given the alias alias . | |
Protected Types | |
using | table_type = std::vector< Attribute > |
Private Attributes | |
ThreadSafePooledString | name_ |
the name of the table | |
table_type | attrs_ |
the attributes of this table, maintained as a sorted set | |
std::unordered_map< ThreadSafePooledString, table_type::size_type > | name_to_attr_ |
maps attribute names to attributes | |
std::unique_ptr< Store > | store_ |
the store backing this table; may be nullptr | |
storage::DataLayout | layout_ |
the physical data layout for this table | |
SmallBitset | primary_key_ |
the primary key of this table, maintained as a SmallBitset over attribute id's | |
Basic implementation of Table
.
Definition at line 609 of file Schema.hpp.
|
inherited |
Definition at line 524 of file Schema.hpp.
|
inherited |
Definition at line 523 of file Schema.hpp.
|
inherited |
Definition at line 522 of file Schema.hpp.
|
protectedinherited |
Definition at line 390 of file Schema.hpp.
|
inline |
Definition at line 620 of file Schema.hpp.
|
virtualdefault |
|
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 717 of file Schema.hpp.
|
inlineoverridevirtual |
Implements m::Table.
Definition at line 675 of file Schema.hpp.
References at().
Referenced by at().
|
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 668 of file Schema.hpp.
References M_insist.
|
inlineoverridevirtual |
Implements m::Table.
Definition at line 656 of file Schema.hpp.
References at().
Referenced by at().
|
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 649 of file Schema.hpp.
|
inlineoverridevirtual |
Implements m::Table.
Definition at line 632 of file Schema.hpp.
|
inlineoverridevirtual |
Implements m::Table.
Definition at line 642 of file Schema.hpp.
|
inlineoverridevirtual |
Implements m::Table.
Definition at line 637 of file Schema.hpp.
|
inlineoverridevirtual |
Implements m::Table.
Definition at line 634 of file Schema.hpp.
|
inlineoverridevirtual |
Implements m::Table.
Definition at line 644 of file Schema.hpp.
|
inlineoverridevirtual |
Implements m::Table.
Definition at line 639 of file Schema.hpp.
|
inlineoverridevirtual |
Implements m::Table.
Definition at line 635 of file Schema.hpp.
|
inlineoverridevirtual |
Implements m::Table.
Definition at line 645 of file Schema.hpp.
|
inlineoverridevirtual |
Implements m::Table.
Definition at line 640 of file Schema.hpp.
|
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 736 of file Schema.hpp.
References id.
|
overridevirtual |
|
overridevirtual |
Implements m::Table.
Definition at line 107 of file Schema.cpp.
|
inlineoverridevirtual |
Implements m::Table.
Definition at line 633 of file Schema.hpp.
|
inlineoverridevirtual |
Implements m::Table.
Definition at line 643 of file Schema.hpp.
|
inlineoverridevirtual |
Implements m::Table.
Definition at line 638 of file Schema.hpp.
|
inlineoverridevirtual |
Returns true
iff the table has an attribute name
.
Implements m::Table.
Definition at line 681 of file Schema.hpp.
|
inlineoverridevirtual |
Returns a reference to the physical data layout.
Implements m::Table.
Definition at line 702 of file Schema.hpp.
References M_insist.
|
overridevirtual |
Sets the physical data layout for this table by calling factory.make()
.
Implements m::Table.
Definition at line 101 of file Schema.cpp.
References m::storage::DataLayoutFactory::make().
|
inlineoverridevirtual |
Sets the physical data layout for this table.
Implements m::Table.
Definition at line 704 of file Schema.hpp.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Returns the number of attributes in this table.
Implements m::Table.
Definition at line 630 of file Schema.hpp.
|
inlineoverridevirtual |
Returns the number of non-hidden attributes in this table.
Implements m::Table.
Definition at line 624 of file Schema.hpp.
|
inlineoverridevirtual |
Returns the number of hidden attributes in this table.
Implements m::Table.
Definition at line 627 of file Schema.hpp.
|
inlineoverridevirtual |
Implements m::Table.
Definition at line 691 of file Schema.hpp.
|
inlineoverridevirtual |
Returns true
iff the Table
other
is the same as this
, false
otherwise.
Implements m::Table.
Definition at line 684 of file Schema.hpp.
References M_unreachable.
|
inlineoverridevirtual |
Implements m::Table.
Definition at line 678 of file Schema.hpp.
|
inlineoverridevirtual |
Returns the attribute with the given name
.
Implements m::Table.
Definition at line 677 of file Schema.hpp.
References operator[]().
Referenced by operator[]().
|
inlineoverridevirtual |
Implements m::Table.
Definition at line 664 of file Schema.hpp.
|
inlineoverridevirtual |
Returns the attribute with the given id
.
Implements m::Table.
Definition at line 658 of file Schema.hpp.
|
inlineoverridevirtual |
Returns all attributes forming the primary key.
Implements m::Table.
Definition at line 709 of file Schema.hpp.
|
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 724 of file Schema.hpp.
|
pure virtualinherited |
Returns a Schema
for this Table
given the alias alias
.
Implemented in m::TableDecorator.
Referenced by m::ScanOperator::ScanOperator().
|
override |
Returns a Schema
for this Table
given the alias alias
.
Definition at line 83 of file Schema.cpp.
References m::Schema::add(), m::and, m::Pooled< T, Pool, CanBeNone >::has_value(), m::Schema::entry_type::IS_HIDDEN, m::Schema::entry_type::NOT_NULLABLE, m::Schema::entry_type::REFERENCES_UNIQUE, and m::Schema::entry_type::UNIQUE.
|
inlineoverridevirtual |
Returns a reference to the backing store.
Implements m::Table.
Definition at line 697 of file Schema.hpp.
|
inlineoverridevirtual |
Sets the backing store for this table.
new_store
must not be nullptr
.
Implements m::Table.
Definition at line 699 of file Schema.hpp.
References m::swap().
|
private |
the attributes of this table, maintained as a sorted set
Definition at line 613 of file Schema.hpp.
|
private |
the physical data layout for this table
Definition at line 616 of file Schema.hpp.
|
private |
the name of the table
Definition at line 612 of file Schema.hpp.
|
private |
maps attribute names to attributes
Definition at line 614 of file Schema.hpp.
|
private |
the primary key of this table, maintained as a SmallBitset
over attribute id's
Definition at line 617 of file Schema.hpp.
|
private |
the store backing this table; may be nullptr
Definition at line 615 of file Schema.hpp.