mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends
m::wasm::HashTable::the_entry< IsConst > Struct Template Reference

Helper struct as proxy to access a hash table entry. More...

#include <WasmAlgo.hpp>

Collaboration diagram for m::wasm::HashTable::the_entry< IsConst >:
[legend]

Public Types

using value_t = std::variant< std::monostate #define ADD_TYPE(TYPE) SQL_TYPES_SCALAR(ADD_TYPE) >
 

Public Member Functions

 the_entry ()=default
 
 the_entry (const the_entry &)=delete
 
 the_entry (the_entry &&)=default
 
 ~the_entry ()
 
 operator the_entry< true > ()
 

‍Converts a non-const entry to a const entry. The former entry is moved, i.e. must not be used afterwards.


 
bool empty () const
 

‍Returns true iff this does not contain any references.


 
bool has (const Schema::Identifier &id) const
 

‍Returns true iff this contains identifier id.


 
template<sql_type T>
void add (Schema::Identifier id, the_reference< T, IsConst > &&ref)
 

‍Adds a mapping from identifier id to reference ref.


 
value_t extract (const Schema::Identifier &id)
 

‍Returns the moved entry for identifier id.


 
template<sql_type T>
the_reference< T, IsConstextract (const Schema::Identifier &id)
 

‍Returns the moved entry for identifier id.


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

‍Returns the copied entry for identifier id.


 
template<sql_type T>
the_reference< T, IsConstget (const Schema::Identifier &id) const
 

‍Returns the copied entry for identifier id.


 

Private Member Functions

 the_entry (std::unordered_multimap< Schema::Identifier, typename the_entry< not IsConst >::value_t > refs)
 

‍constructs an entry from references of the opposite const-ness


 

Static Private Member Functions

static void discard (value_t &ref)
 

‍Discards the held reference of ref.


 

Private Attributes

std::unordered_multimap< Schema::Identifier, value_trefs_
 

‍maps Schema::Identifiers to the_reference<T, IsConst>s that reference the stored expression, allows for duplicates similar to Schema


 

Friends

struct HashTable
 

Detailed Description

template<bool IsConst>
struct m::wasm::HashTable::the_entry< IsConst >

Helper struct as proxy to access a hash table entry.

Definition at line 368 of file WasmAlgo.hpp.

Member Typedef Documentation

◆ value_t

template<bool IsConst>
using m::wasm::HashTable::the_entry< IsConst >::value_t = std::variant< std::monostate #define ADD_TYPE(TYPE) SQL_TYPES_SCALAR(ADD_TYPE) >

Definition at line 372 of file WasmAlgo.hpp.

Constructor & Destructor Documentation

◆ the_entry() [1/4]

template<bool IsConst>
m::wasm::HashTable::the_entry< IsConst >::the_entry ( )
default

◆ the_entry() [2/4]

template<bool IsConst>
m::wasm::HashTable::the_entry< IsConst >::the_entry ( const the_entry< IsConst > &  )
delete

◆ the_entry() [3/4]

template<bool IsConst>
m::wasm::HashTable::the_entry< IsConst >::the_entry ( the_entry< IsConst > &&  )
default

◆ the_entry() [4/4]

template<bool IsConst>
m::wasm::HashTable::the_entry< IsConst >::the_entry ( std::unordered_multimap< Schema::Identifier, typename the_entry< not IsConst >::value_t refs)
inlineprivate

‍constructs an entry from references of the opposite const-ness

Definition at line 400 of file WasmAlgo.hpp.

References M_unreachable, m::wasm::HashTable::the_entry< IsConst >::refs_, and m::T().

◆ ~the_entry()

template<bool IsConst>
m::wasm::HashTable::the_entry< IsConst >::~the_entry ( )
inline

Member Function Documentation

◆ add()

template<bool IsConst>
template<sql_type T>
void m::wasm::HashTable::the_entry< IsConst >::add ( Schema::Identifier  id,
the_reference< T, IsConst > &&  ref 
)
inline

◆ discard()

template<bool IsConst>
static void m::wasm::HashTable::the_entry< IsConst >::discard ( value_t ref)
inlinestaticprivate

‍Discards the held reference of ref.

Definition at line 381 of file WasmAlgo.hpp.

References M_unreachable.

◆ empty()

template<bool IsConst>
bool m::wasm::HashTable::the_entry< IsConst >::empty ( ) const
inline

‍Returns true iff this does not contain any references.

Definition at line 431 of file WasmAlgo.hpp.

References m::wasm::HashTable::the_entry< IsConst >::refs_.

◆ extract() [1/2]

template<bool IsConst>
value_t m::wasm::HashTable::the_entry< IsConst >::extract ( const Schema::Identifier id)
inline

‍Returns the moved entry for identifier id.

Definition at line 443 of file WasmAlgo.hpp.

References M_insist, and m::wasm::HashTable::the_entry< IsConst >::refs_.

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

◆ extract() [2/2]

template<bool IsConst>
template<sql_type T>
the_reference< T, IsConst > m::wasm::HashTable::the_entry< IsConst >::extract ( const Schema::Identifier id)
inline

‍Returns the moved entry for identifier id.

Definition at line 451 of file WasmAlgo.hpp.

References M_insist, and m::wasm::HashTable::the_entry< IsConst >::refs_.

◆ get() [1/2]

template<bool IsConst>
value_t m::wasm::HashTable::the_entry< IsConst >::get ( const Schema::Identifier id) const
inline

◆ get() [2/2]

template<bool IsConst>
template<sql_type T>
the_reference< T, IsConst > m::wasm::HashTable::the_entry< IsConst >::get ( const Schema::Identifier id) const
inline

‍Returns the copied entry for identifier id.

Definition at line 473 of file WasmAlgo.hpp.

◆ has()

template<bool IsConst>
bool m::wasm::HashTable::the_entry< IsConst >::has ( const Schema::Identifier id) const
inline

‍Returns true iff this contains identifier id.

Definition at line 434 of file WasmAlgo.hpp.

References m::wasm::HashTable::the_entry< IsConst >::refs_.

◆ operator the_entry< true >()

template<bool IsConst>
m::wasm::HashTable::the_entry< IsConst >::operator the_entry< true > ( )
inline

‍Converts a non-const entry to a const entry. The former entry is moved, i.e. must not be used afterwards.

Definition at line 428 of file WasmAlgo.hpp.

References m::wasm::HashTable::the_entry< IsConst >::refs_, and m::wasm::HashTable::the_entry< true >.

Friends And Related Function Documentation

◆ HashTable

template<bool IsConst>
friend struct HashTable
friend

Definition at line 370 of file WasmAlgo.hpp.

Field Documentation

◆ refs_

template<bool IsConst>
std::unordered_multimap<Schema::Identifier, value_t> m::wasm::HashTable::the_entry< IsConst >::refs_
private

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