![]() |
mutable
A Database System for Research and Fast Prototyping
|
A Schema represents a sequence of identifiers, optionally with a prefix, and their associated types.
More...
#include <Schema.hpp>
Data Structures | |
| struct | entry_type |
| struct | Identifier |
An Identifier is composed of a name and an optional prefix. More... | |
Public Types | |
| using | iterator = decltype(entries_)::iterator |
| using | const_iterator = decltype(entries_)::const_iterator |
Public Member Functions | |
| const std::vector< entry_type > & | entries () const |
| iterator | begin () |
| iterator | end () |
| const_iterator | begin () const |
| const_iterator | end () const |
| const_iterator | cbegin () const |
| const_iterator | cend () const |
| std::size_t | num_entries () const |
Returns the number of entries in this Schema. | |
| bool | empty () const |
| iterator | find (const Identifier &id) |
Returns an iterator to the entry with the given Identifier id, or end() if no such entry exists. | |
| const_iterator | find (const Identifier &id) const |
Returns an iterator to the entry with the given Identifier id, or end() if no such entry exists. | |
| bool | has (const Identifier &id) const |
Returns true iff this Schema contains an entry with Identifier id. | |
| entry_type & | at (std::size_t idx) |
Returns the entry at index idx with in-bounds checking. | |
| const entry_type & | at (std::size_t idx) const |
Returns the entry at index idx with in-bounds checking. | |
| entry_type & | operator[] (std::size_t idx) |
Returns the entry at index idx. | |
| const entry_type & | operator[] (std::size_t idx) const |
Returns the entry at index idx. | |
| std::pair< std::size_t, entry_type & > | at (const Identifier &id) |
Returns a std::pair of the index and a reference to the entry with Identifier id with in-bounds checking. | |
| std::pair< std::size_t, const entry_type & > | at (const Identifier &id) const |
Returns a std::pair of the index and a reference to the entry with Identifier id with in-bounds checking. | |
| std::pair< std::size_t, entry_type & > | operator[] (const Identifier &id) |
Returns a std::pair of the index and a reference to the entry with Identifier id. | |
| std::pair< std::size_t, const entry_type & > | operator[] (const Identifier &id) const |
Returns a std::pair of the index and a reference to the entry with Identifier id. | |
| void | add (entry_type e) |
Adds the entry e to this Schema. | |
| void | add (Identifier id, const Type *type) |
Adds a new entry id of type type to this Schema. | |
| void | add (Identifier id, const Type *type, entry_type::constraints_t constraints) |
Adds a new entry id of type type with constraints constraints to this Schema. | |
| Schema | deduplicate () const |
Returns a deduplicated version of this Schema, i.e. | |
| Schema | drop_constants () const |
Returns a copy of this Schema where all constant entries are removed. | |
| Schema & | operator+= (const Schema &other) |
Adds all entries of other to this Schema, potentially introducing duplicates. | |
| Schema & | operator|= (const Schema &other) |
Adds all entries of other to this Schema using set semantics. | |
| bool | operator== (const Schema &other) const |
Checks whether two Schemas have identical Identifiers by checking for mutual set-inclusion. | |
| bool | operator!= (const Schema &other) const |
| M_LCOV_EXCL_STOP void | dump (std::ostream &out) const |
| void | dump () const |
Private Attributes | |
| std::vector< entry_type > | entries_ |
Friends | |
| M_LCOV_EXCL_START friend std::ostream & | operator<< (std::ostream &out, const Schema &schema) |
A Schema represents a sequence of identifiers, optionally with a prefix, and their associated types.
The Schema allows identifiers of the same name with different prefix.
Definition at line 38 of file Schema.hpp.
| using m::Schema::const_iterator = decltype(entries_)::const_iterator |
Definition at line 112 of file Schema.hpp.
| using m::Schema::iterator = decltype(entries_)::iterator |
Definition at line 111 of file Schema.hpp.
|
inline |
Adds the entry e to this Schema.
Definition at line 181 of file Schema.hpp.
Referenced by m::wasm::HashBasedGrouping::execute(), m::wasm::HashBasedGroupJoin::execute(), m::wasm::OrderedGrouping::execute(), m::CreateIndex::execute(), m::ast::Expr::get_required(), m::DSVReader::operator()(), m::Optimizer::optimize_source_plans(), and m::ConcreteTable::schema().
|
inline |
Adds a new entry id of type type to this Schema.
Definition at line 183 of file Schema.hpp.
|
inline |
Adds a new entry id of type type with constraints constraints to this Schema.
Definition at line 185 of file Schema.hpp.
|
inline |
Returns a std::pair of the index and a reference to the entry with Identifier id with in-bounds checking.
Definition at line 160 of file Schema.hpp.
|
inline |
Returns a std::pair of the index and a reference to the entry with Identifier id with in-bounds checking.
Definition at line 168 of file Schema.hpp.
References at().
Referenced by at().
|
inline |
Returns the entry at index idx with in-bounds checking.
Definition at line 143 of file Schema.hpp.
Referenced by m::idx::IndexBase::build_query(), and m::idx::ArrayIndex< Key >::bulkload().
|
inline |
Returns the entry at index idx with in-bounds checking.
Definition at line 149 of file Schema.hpp.
References at().
Referenced by at().
|
inline |
Definition at line 116 of file Schema.hpp.
Referenced by compile_data_layout(), m::StackMachine::emit(), and operator==().
|
inline |
Definition at line 118 of file Schema.hpp.
|
inline |
Definition at line 120 of file Schema.hpp.
Referenced by m::storage::DataLayoutFactory::make().
|
inline |
Definition at line 121 of file Schema.hpp.
Referenced by m::wasm::and(), m::wasm::compile_data_layout_point_access(), and m::storage::DataLayoutFactory::make().
|
inline |
Returns a deduplicated version of this Schema, i.e.
duplicate entries are only contained once.
Definition at line 190 of file Schema.hpp.
Referenced by m::wasm::and(), m::wasm::compile_data_layout_point_access(), m::Match< wasm::Scan< SIMDfied > >::execute(), m::execute_buffered(), and write_result_set().
|
inline |
Returns a copy of this Schema where all constant entries are removed.
Definition at line 200 of file Schema.hpp.
Referenced by m::wasm::and(), m::wasm::compile_data_layout_point_access(), m::Match< wasm::Scan< SIMDfied > >::execute(), m::execute_buffered(), and write_result_set().
| void Schema::dump | ( | ) | const |
Definition at line 51 of file Schema.cpp.
References dump().
Referenced by dump(), m::Attribute::dump(), and m::ConcreteTable::dump().
| M_LCOV_EXCL_START void Schema::dump | ( | std::ostream & | out | ) | const |
Definition at line 50 of file Schema.cpp.
|
inline |
Definition at line 126 of file Schema.hpp.
|
inline |
Definition at line 117 of file Schema.hpp.
Referenced by compile_data_layout(), m::StackMachine::emit(), m::operator&(), and operator==().
|
inline |
Definition at line 119 of file Schema.hpp.
|
inline |
Definition at line 114 of file Schema.hpp.
|
inline |
Returns an iterator to the entry with the given Identifier id, or end() if no such entry exists.
Definition at line 129 of file Schema.hpp.
Referenced by m::wasm::and(), compile_data_layout(), m::wasm::compile_data_layout_point_access(), m::StackMachine::emit(), m::wasm::HashBasedGroupJoin::execute(), and m::operator&().
|
inline |
Returns an iterator to the entry with the given Identifier id, or end() if no such entry exists.
Definition at line 137 of file Schema.hpp.
References find().
Referenced by find().
|
inline |
Returns true iff this Schema contains an entry with Identifier id.
Definition at line 140 of file Schema.hpp.
Referenced by decompose_equi_predicate(), m::ast::Expr::get_required(), and operator==().
|
inline |
Returns the number of entries in this Schema.
Definition at line 124 of file Schema.hpp.
Referenced by m::wasm::and(), m::wasm::Buffer< IsGlobal >::Buffer(), m::idx::IndexBase::build_query(), m::idx::ArrayIndex< Key >::bulkload(), m::Tuple::clone(), compile_data_layout(), m::wasm::compile_data_layout_point_access(), compute_aggregate_info(), m::StackMachine::emit(), m::wasm::HashTable::HashTable(), m::wasm::IndexScan< IndexMethod >::post_condition(), m::Tuple::print(), and write_result_set().
|
inline |
Definition at line 233 of file Schema.hpp.
Adds all entries of other to this Schema, potentially introducing duplicates.
In other words, no duplicate checking is performed.
Definition at line 211 of file Schema.hpp.
|
inline |
Checks whether two Schemas have identical Identifiers by checking for mutual set-inclusion.
Definition at line 229 of file Schema.hpp.
References and(), begin(), end(), has(), and m::Schema::entry_type::id.
|
inline |
Returns a std::pair of the index and a reference to the entry with Identifier id.
Definition at line 170 of file Schema.hpp.
References M_insist.
|
inline |
Returns a std::pair of the index and a reference to the entry with Identifier id.
Definition at line 176 of file Schema.hpp.
|
inline |
|
inline |
Returns the entry at index idx.
Definition at line 156 of file Schema.hpp.
Adds all entries of other to this Schema using set semantics.
If an entry of other with a particular Identifier already exists in this, it is not added again. In other words, elements of other are added to this with duplicate checking.
Definition at line 220 of file Schema.hpp.
|
friend |
Definition at line 236 of file Schema.hpp.
|
private |
Definition at line 108 of file Schema.hpp.