mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes
m::wasm::Environment Struct Reference

Binds Schema::Identifiers to Expr<T>s. More...

#include <WasmUtil.hpp>

Collaboration diagram for m::wasm::Environment:
[legend]

Public Member Functions

 Environment ()=default
 
 Environment (const Environment &)=delete
 
 Environment (Environment &&)=default
 
 ~Environment ()
 
bool has (const Schema::Identifier &id) const
 Returns true iff this Environment contains id.
 
bool has_addr (const Schema::Identifier &id) const
 Returns true iff this Environment contains the address of id.
 
template<sql_type T>
bool is (const Schema::Identifier &id) const
 Returns true iff the entry for identifier id has sql_type
 
template<sql_addr_type T>
bool is_addr (Schema::Identifier id) const
 Returns true iff the address entry for identifier id has sql_addr_type
 
bool empty () const
 Returns true iff this Environment is empty.
 
void clear ()
 Clears this Environment.
 
template<sql_type T>
void add (Schema::Identifier id, T &&expr)
 

‍Adds a mapping from id to expr.


 
void add (Schema::Identifier id, SQL_t &&expr)
 

‍Adds a mapping from id to expr.


 
template<sql_addr_type T>
void add_addr (Schema::Identifier id, T &&expr)
 

‍Adds a address mapping from id to expr.


 
void add_addr (Schema::Identifier id, SQL_addr_t &&expr)
 

‍Adds a address mapping from id to expr.


 
void add (const Environment &other)
 

Copies all entries of other into this.


 
void add (Environment &&other)
 

Moves all entries of other into this.


 
SQL_t extract (const Schema::Identifier &id)
 

‍Returns the moved entry for identifier id.


 
template<sql_type T>
T extract (const Schema::Identifier &id)
 

‍Returns the moved entry for identifier id.


 
SQL_addr_t extract_addr (const Schema::Identifier &id)
 

‍Returns the moved address entry for identifier id.


 
template<sql_addr_type T>
T extract_addr (const Schema::Identifier &id)
 

‍Returns the moved address entry for identifier id.


 
SQL_t get (const Schema::Identifier &id) const
 

‍Returns the copied entry for identifier id.


 
template<sql_type T>
T get (const Schema::Identifier &id) const
 

‍Returns the copied entry for identifier id.


 
SQL_addr_t get_addr (const Schema::Identifier &id) const
 

‍Returns the copied address entry for identifier id.


 
template<sql_addr_type T>
T get_addr (const Schema::Identifier &id) const
 

‍Returns the copied address entry for identifier id.


 
SQL_t operator[] (const Schema::Identifier &id) const
 

‍Returns the copied entry for identifier id.


 
template<typename T >
requires requires (ExprCompiler C, T &&t) { C.compile(std::forward<T>(t)); }
auto compile (T &&t) const
 

‍Compile t by delegating compilation to an ExprCompiler for this Environment.


 
template<typename T , typename U >
requires requires (ExprCompiler C, U &&u) { C.compile<T>(std::forward<U>(u)); }
auto compile (U &&u) const
 

‍Compile t by delegating compilation to an ExprCompiler for this Environment.


 
bool predicated () const
 

‍Returns true iff this Environment uses predication.


 
void add_predicate (SQL_boolean_t &&pred)
 

‍Adds the predicate pred to the predication predicate.


 
template<sql_boolean_type T>
void add_predicate (T &&pred)
 

‍Adds the predicate pred to the predication predicate.


 
void add_predicate (const cnf::CNF &cnf)
 

‍Adds the predicate compiled from the cnf::CNF cnf to the predication predicate.


 
SQL_boolean_t extract_predicate ()
 

‍Returns the moved current predication predicate.


 
template<sql_boolean_type T>
T extract_predicate ()
 

‍Returns the moved current predication predicate.


 
SQL_boolean_t get_predicate () const
 

‍Returns the copied current predication predicate.


 
template<sql_boolean_type T>
T get_predicate () const
 

‍Returns the copied current predication predicate.


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

Private Attributes

std::unordered_map< Schema::Identifier, SQL_texprs_
 

‍maps Schema::Identifiers to Expr<T>s that evaluate to the current expression


 
std::unordered_map< Schema::Identifier, SQL_addr_texpr_addrs_
 

‍maps Schema::Identifiers to Ptr<Expr<T>>s that evaluate to the address of the current expression


 
SQL_boolean_t predicate_
 

‍optional predicate if predication is used


 

Detailed Description

Binds Schema::Identifiers to Expr<T>s.

Definition at line 562 of file WasmUtil.hpp.

Constructor & Destructor Documentation

◆ Environment() [1/3]

m::wasm::Environment::Environment ( )
default

◆ Environment() [2/3]

m::wasm::Environment::Environment ( const Environment )
delete

◆ Environment() [3/3]

m::wasm::Environment::Environment ( Environment &&  )
default

◆ ~Environment()

m::wasm::Environment::~Environment ( )
inline

Definition at line 577 of file WasmUtil.hpp.

References m::wasm::discard(), expr_addrs_, and exprs_.

Member Function Documentation

◆ add() [1/4]

void m::wasm::Environment::add ( const Environment other)
inline

Copies all entries of other into this.

Definition at line 642 of file WasmUtil.hpp.

References add(), add_addr(), expr_addrs_, exprs_, and M_unreachable.

◆ add() [2/4]

void m::wasm::Environment::add ( Environment &&  other)
inline

Moves all entries of other into this.

Definition at line 657 of file WasmUtil.hpp.

References M_insist.

◆ add() [3/4]

void m::wasm::Environment::add ( Schema::Identifier  id,
SQL_t &&  expr 
)
inline

‍Adds a mapping from id to expr.

Definition at line 624 of file WasmUtil.hpp.

References exprs_, M_insist, and m::wasm::res.

◆ add() [4/4]

template<sql_type T>
void m::wasm::Environment::add ( Schema::Identifier  id,
T &&  expr 
)
inline

◆ add_addr() [1/2]

void m::wasm::Environment::add_addr ( Schema::Identifier  id,
SQL_addr_t &&  expr 
)
inline

‍Adds a address mapping from id to expr.

Definition at line 636 of file WasmUtil.hpp.

References expr_addrs_, M_insist, and m::wasm::res.

◆ add_addr() [2/2]

template<sql_addr_type T>
void m::wasm::Environment::add_addr ( Schema::Identifier  id,
T &&  expr 
)
inline

‍Adds a address mapping from id to expr.

Definition at line 631 of file WasmUtil.hpp.

References expr_addrs_, M_insist, and m::wasm::res.

Referenced by add().

◆ add_predicate() [1/3]

void m::wasm::Environment::add_predicate ( const cnf::CNF cnf)
inline

‍Adds the predicate compiled from the cnf::CNF cnf to the predication predicate.

Definition at line 776 of file WasmUtil.hpp.

References add_predicate(), and compile().

Referenced by add_predicate().

◆ add_predicate() [2/3]

void m::wasm::Environment::add_predicate ( SQL_boolean_t &&  pred)
inline

◆ add_predicate() [3/3]

template<sql_boolean_type T>
void m::wasm::Environment::add_predicate ( T &&  pred)
inline

‍Adds the predicate pred to the predication predicate.

Definition at line 767 of file WasmUtil.hpp.

References m::wasm::and, predicate_, and predicated().

◆ clear()

void m::wasm::Environment::clear ( )
inline

Clears this Environment.

Definition at line 608 of file WasmUtil.hpp.

References m::wasm::discard(), expr_addrs_, and exprs_.

◆ compile() [1/2]

template<typename T >
requires requires (ExprCompiler C, T &&t) { C.compile(std::forward<T>(t)); }
auto m::wasm::Environment::compile ( T &&  t) const
inline

‍Compile t by delegating compilation to an ExprCompiler for this Environment.

Definition at line 742 of file WasmUtil.hpp.

References m::wasm::ExprCompiler::compile().

Referenced by add_predicate(), and m::wasm::LazyDisjunctiveFilter::execute().

◆ compile() [2/2]

template<typename T , typename U >
requires requires (ExprCompiler C, U &&u) { C.compile<T>(std::forward<U>(u)); }
auto m::wasm::Environment::compile ( U &&  u) const
inline

‍Compile t by delegating compilation to an ExprCompiler for this Environment.

Definition at line 749 of file WasmUtil.hpp.

References m::wasm::ExprCompiler::compile(), and m::T().

◆ dump() [1/2]

void Environment::dump ( ) const

Definition at line 539 of file WasmUtil.cpp.

References dump().

Referenced by dump().

◆ dump() [2/2]

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

Definition at line 522 of file WasmUtil.cpp.

References expr_addrs_, and exprs_.

◆ empty()

bool m::wasm::Environment::empty ( ) const
inline

Returns true iff this Environment is empty.

Definition at line 605 of file WasmUtil.hpp.

References m::wasm::and, expr_addrs_, and exprs_.

◆ extract() [1/2]

SQL_t m::wasm::Environment::extract ( const Schema::Identifier id)
inline

‍Returns the moved entry for identifier id.

Definition at line 665 of file WasmUtil.hpp.

References exprs_, and M_insist.

◆ extract() [2/2]

template<sql_type T>
T m::wasm::Environment::extract ( const Schema::Identifier id)
inline

‍Returns the moved entry for identifier id.

Definition at line 673 of file WasmUtil.hpp.

References exprs_, M_insist, and m::T().

◆ extract_addr() [1/2]

SQL_addr_t m::wasm::Environment::extract_addr ( const Schema::Identifier id)
inline

‍Returns the moved address entry for identifier id.

Definition at line 682 of file WasmUtil.hpp.

References expr_addrs_, and M_insist.

◆ extract_addr() [2/2]

template<sql_addr_type T>
T m::wasm::Environment::extract_addr ( const Schema::Identifier id)
inline

‍Returns the moved address entry for identifier id.

Definition at line 690 of file WasmUtil.hpp.

References expr_addrs_, M_insist, and m::T().

◆ extract_predicate() [1/2]

template _Boolx32 m::wasm::Environment::extract_predicate ( )
inline

‍Returns the moved current predication predicate.

Definition at line 779 of file WasmUtil.hpp.

References M_insist, predicate_, and predicated().

Referenced by m::wasm::Aggregation::execute().

◆ extract_predicate() [2/2]

template<sql_boolean_type T>
T m::wasm::Environment::extract_predicate ( )
inline

‍Returns the moved current predication predicate.

Definition at line 787 of file WasmUtil.hpp.

References M_insist, predicate_, predicated(), and m::T().

◆ get() [1/2]

SQL_t m::wasm::Environment::get ( const Schema::Identifier id) const
inline

◆ get() [2/2]

template<sql_type T>
T m::wasm::Environment::get ( const Schema::Identifier id) const
inline

‍Returns the copied entry for identifier id.

Definition at line 709 of file WasmUtil.hpp.

References exprs_, M_insist, and m::T().

◆ get_addr() [1/2]

SQL_addr_t m::wasm::Environment::get_addr ( const Schema::Identifier id) const
inline

‍Returns the copied address entry for identifier id.

Definition at line 717 of file WasmUtil.hpp.

References expr_addrs_, M_insist, and M_unreachable.

◆ get_addr() [2/2]

template<sql_addr_type T>
T m::wasm::Environment::get_addr ( const Schema::Identifier id) const
inline

‍Returns the copied address entry for identifier id.

Definition at line 727 of file WasmUtil.hpp.

References expr_addrs_, M_insist, and m::T().

◆ get_predicate() [1/2]

template _Boolx32 m::wasm::Environment::get_predicate ( ) const
inline

‍Returns the copied current predication predicate.

Definition at line 797 of file WasmUtil.hpp.

References M_unreachable, and predicate_.

◆ get_predicate() [2/2]

template<sql_boolean_type T>
T m::wasm::Environment::get_predicate ( ) const
inline

‍Returns the copied current predication predicate.

Definition at line 807 of file WasmUtil.hpp.

References M_insist, predicate_, predicated(), and m::T().

◆ has()

bool m::wasm::Environment::has ( const Schema::Identifier id) const
inline

Returns true iff this Environment contains id.

Definition at line 587 of file WasmUtil.hpp.

References exprs_.

Referenced by m::wasm::Projection::execute().

◆ has_addr()

bool m::wasm::Environment::has_addr ( const Schema::Identifier id) const
inline

Returns true iff this Environment contains the address of id.

Definition at line 589 of file WasmUtil.hpp.

References expr_addrs_.

◆ is()

template<sql_type T>
bool m::wasm::Environment::is ( const Schema::Identifier id) const
inline

Returns true iff the entry for identifier id has sql_type

Template Parameters
T.

Definition at line 592 of file WasmUtil.hpp.

References exprs_, and M_insist.

◆ is_addr()

template<sql_addr_type T>
bool m::wasm::Environment::is_addr ( Schema::Identifier  id) const
inline

Returns true iff the address entry for identifier id has sql_addr_type

Template Parameters
T.

Definition at line 599 of file WasmUtil.hpp.

References expr_addrs_, and M_insist.

◆ operator[]()

SQL_t m::wasm::Environment::operator[] ( const Schema::Identifier id) const
inline

‍Returns the copied entry for identifier id.

Definition at line 735 of file WasmUtil.hpp.

References get().

◆ predicated()

bool m::wasm::Environment::predicated ( ) const
inline

‍Returns true iff this Environment uses predication.

Definition at line 756 of file WasmUtil.hpp.

References predicate_.

Referenced by add_predicate(), extract_predicate(), and get_predicate().

Field Documentation

◆ expr_addrs_

std::unordered_map<Schema::Identifier, SQL_addr_t> m::wasm::Environment::expr_addrs_
private

‍maps Schema::Identifiers to Ptr<Expr<T>>s that evaluate to the address of the current expression

Definition at line 568 of file WasmUtil.hpp.

Referenced by add(), add_addr(), clear(), dump(), empty(), extract_addr(), get_addr(), has_addr(), is_addr(), and ~Environment().

◆ exprs_

std::unordered_map<Schema::Identifier, SQL_t> m::wasm::Environment::exprs_
private

‍maps Schema::Identifiers to Expr<T>s that evaluate to the current expression

Definition at line 566 of file WasmUtil.hpp.

Referenced by add(), clear(), dump(), empty(), extract(), get(), has(), is(), and ~Environment().

◆ predicate_

SQL_boolean_t m::wasm::Environment::predicate_
private

‍optional predicate if predication is used

Definition at line 570 of file WasmUtil.hpp.

Referenced by add_predicate(), extract_predicate(), get_predicate(), and predicated().


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