mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Data Structures | Public Types | Public Member Functions | Private Attributes | Friends
m::Schema Struct Reference

A Schema represents a sequence of identifiers, optionally with a prefix, and their associated types. More...

#include <Schema.hpp>

Collaboration diagram for m::Schema:
[legend]

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_typeat (std::size_t idx)
 Returns the entry at index idx with in-bounds checking.
 
const entry_typeat (std::size_t idx) const
 Returns the entry at index idx with in-bounds checking.
 
entry_typeoperator[] (std::size_t idx)
 Returns the entry at index idx.
 
const entry_typeoperator[] (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.
 
Schemaoperator+= (const Schema &other)
 Adds all entries of other to this Schema, potentially introducing duplicates.
 
Schemaoperator|= (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_typeentries_
 

Friends

M_LCOV_EXCL_START friend std::ostream & operator<< (std::ostream &out, const Schema &schema)
 

Detailed Description

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.

Member Typedef Documentation

◆ const_iterator

using m::Schema::const_iterator = decltype(entries_)::const_iterator

Definition at line 112 of file Schema.hpp.

◆ iterator

using m::Schema::iterator = decltype(entries_)::iterator

Definition at line 111 of file Schema.hpp.

Member Function Documentation

◆ add() [1/3]

void m::Schema::add ( entry_type  e)
inline

◆ add() [2/3]

void m::Schema::add ( Identifier  id,
const Type type 
)
inline

Adds a new entry id of type type to this Schema.

Definition at line 183 of file Schema.hpp.

◆ add() [3/3]

void m::Schema::add ( Identifier  id,
const Type type,
entry_type::constraints_t  constraints 
)
inline

Adds a new entry id of type type with constraints constraints to this Schema.

Definition at line 185 of file Schema.hpp.

◆ at() [1/4]

std::pair< std::size_t, entry_type & > m::Schema::at ( const Identifier id)
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.

◆ at() [2/4]

std::pair< std::size_t, const entry_type & > m::Schema::at ( const Identifier id) const
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().

◆ at() [3/4]

entry_type & m::Schema::at ( std::size_t  idx)
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().

◆ at() [4/4]

const entry_type & m::Schema::at ( std::size_t  idx) const
inline

Returns the entry at index idx with in-bounds checking.

Definition at line 149 of file Schema.hpp.

References at().

Referenced by at().

◆ begin() [1/2]

iterator m::Schema::begin ( )
inline

Definition at line 116 of file Schema.hpp.

Referenced by compile_data_layout(), m::StackMachine::emit(), and operator==().

◆ begin() [2/2]

const_iterator m::Schema::begin ( ) const
inline

Definition at line 118 of file Schema.hpp.

◆ cbegin()

const_iterator m::Schema::cbegin ( ) const
inline

Definition at line 120 of file Schema.hpp.

Referenced by m::storage::DataLayoutFactory::make().

◆ cend()

const_iterator m::Schema::cend ( ) const
inline

◆ deduplicate()

Schema m::Schema::deduplicate ( ) const
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().

◆ drop_constants()

Schema m::Schema::drop_constants ( ) const
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().

◆ dump() [1/2]

void Schema::dump ( ) const

Definition at line 51 of file Schema.cpp.

References dump().

Referenced by dump(), m::Attribute::dump(), and m::ConcreteTable::dump().

◆ dump() [2/2]

M_LCOV_EXCL_START void Schema::dump ( std::ostream &  out) const

Definition at line 50 of file Schema.cpp.

◆ empty()

bool m::Schema::empty ( ) const
inline

Definition at line 126 of file Schema.hpp.

◆ end() [1/2]

iterator m::Schema::end ( )
inline

Definition at line 117 of file Schema.hpp.

Referenced by compile_data_layout(), m::StackMachine::emit(), m::operator&(), and operator==().

◆ end() [2/2]

const_iterator m::Schema::end ( ) const
inline

Definition at line 119 of file Schema.hpp.

◆ entries()

const std::vector< entry_type > & m::Schema::entries ( ) const
inline

Definition at line 114 of file Schema.hpp.

◆ find() [1/2]

iterator m::Schema::find ( const Identifier id)
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.

References and(), and id.

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&().

◆ find() [2/2]

const_iterator m::Schema::find ( const Identifier id) const
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().

◆ has()

bool m::Schema::has ( const Identifier id) const
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==().

◆ num_entries()

std::size_t m::Schema::num_entries ( ) const
inline

◆ operator!=()

bool m::Schema::operator!= ( const Schema other) const
inline

Definition at line 233 of file Schema.hpp.

◆ operator+=()

Schema & m::Schema::operator+= ( const Schema other)
inline

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.

◆ operator==()

bool m::Schema::operator== ( const Schema other) const
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.

◆ operator[]() [1/4]

std::pair< std::size_t, entry_type & > m::Schema::operator[] ( const Identifier 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.

◆ operator[]() [2/4]

std::pair< std::size_t, const entry_type & > m::Schema::operator[] ( const Identifier id) const
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.

◆ operator[]() [3/4]

entry_type & m::Schema::operator[] ( std::size_t  idx)
inline

Returns the entry at index idx.

Definition at line 151 of file Schema.hpp.

References M_insist.

◆ operator[]() [4/4]

const entry_type & m::Schema::operator[] ( std::size_t  idx) const
inline

Returns the entry at index idx.

Definition at line 156 of file Schema.hpp.

◆ operator|=()

Schema & m::Schema::operator|= ( const Schema other)
inline

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.

Friends And Related Function Documentation

◆ operator<<

M_LCOV_EXCL_START friend std::ostream & operator<< ( std::ostream &  out,
const Schema schema 
)
friend

Definition at line 236 of file Schema.hpp.

Field Documentation

◆ entries_

std::vector<entry_type> m::Schema::entries_
private

Definition at line 108 of file Schema.hpp.


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