Yume
Public Member Functions | List of all members
yume::Substitutions Struct Reference

#include <substitution.hpp>

Public Member Functions

 Substitutions ()=delete
 
 Substitutions (vector< GenericKey > keys, const vector< unique_ptr< ty::Generic > > &generic_type_fallbacks, nullable< Substitutions * > parent=nullptr)
 
 Substitutions (vector< GenericKey > keys, vector< ty::Generic * > generic_type_fallbacks, nullable< Substitutions * > parent=nullptr)
 
auto empty () const -> bool
 
auto size () const -> size_t
 
auto fully_substituted () const -> bool
 
auto mapping_ref_or_null (const GenericKey &generic) -> nullable< GenericValue * >
 
auto mapping_ref_or_null (const GenericKey &generic) const -> nullable< const GenericValue * >
 
auto mapping_ref (const GenericKey &generic) -> GenericValue &
 
auto mapping_ref (const GenericKey &generic) const -> const GenericValue &
 
auto find_type (string_view generic_name) const -> optional< ty::Type >
 
auto type_mappings () const -> std::map< string, ty::Type >
 
void associate (const GenericKey &key, GenericValue value)
 
auto append_new_association (GenericKey key) -> GenericValue &
 
void dump (llvm::raw_ostream &os) const
 
auto all_keys () const -> vector< const GenericKey * >
 
auto all_values () const -> vector< const GenericValue * >
 
auto all_values () -> vector< GenericValue * >
 
auto mapping ()
 
auto mapping () const
 
auto get_generic_fallback (string_view generic_name) const -> ty::Generic *
 
auto operator== (const Substitutions &other) const noexcept -> bool
 

Detailed Description

Definition at line 68 of file substitution.hpp.

Constructor & Destructor Documentation

◆ Substitutions() [1/3]

yume::Substitutions::Substitutions ( )
delete

◆ Substitutions() [2/3]

yume::Substitutions::Substitutions ( vector< GenericKey keys,
const vector< unique_ptr< ty::Generic > > &  generic_type_fallbacks,
nullable< Substitutions * >  parent = nullptr 
)
inline

Definition at line 76 of file substitution.hpp.

◆ Substitutions() [3/3]

yume::Substitutions::Substitutions ( vector< GenericKey keys,
vector< ty::Generic * >  generic_type_fallbacks,
nullable< Substitutions * >  parent = nullptr 
)
inline

Definition at line 93 of file substitution.hpp.

Member Function Documentation

◆ all_keys()

auto yume::Substitutions::all_keys ( ) const -> vector<const GenericKey*>
inline

Definition at line 161 of file substitution.hpp.

Referenced by mapping(), and operator==().

◆ all_values() [1/2]

auto yume::Substitutions::all_values ( ) -> vector<GenericValue*>
inline

Definition at line 177 of file substitution.hpp.

◆ all_values() [2/2]

auto yume::Substitutions::all_values ( ) const -> vector<const GenericValue*>
inline

Definition at line 169 of file substitution.hpp.

Referenced by mapping(), and operator==().

◆ append_new_association()

auto yume::Substitutions::append_new_association ( GenericKey  key) -> GenericValue&
inline

Definition at line 147 of file substitution.hpp.

◆ associate()

void yume::Substitutions::associate ( const GenericKey key,
GenericValue  value 
)
inline

Definition at line 145 of file substitution.hpp.

References mapping_ref().

◆ dump()

void yume::Substitutions::dump ( llvm::raw_ostream &  os) const
inline

Definition at line 152 of file substitution.hpp.

◆ empty()

auto yume::Substitutions::empty ( ) const -> bool
inline

Definition at line 109 of file substitution.hpp.

Referenced by yume::semantic::Overload::dump(), and fully_substituted().

◆ find_type()

auto yume::Substitutions::find_type ( string_view  generic_name) const -> optional<ty::Type>
inline

Definition at line 129 of file substitution.hpp.

References mapping(), mapping_ref_or_null(), and YUME_ASSERT.

◆ fully_substituted()

auto yume::Substitutions::fully_substituted ( ) const -> bool
inline

◆ get_generic_fallback()

auto yume::Substitutions::get_generic_fallback ( string_view  generic_name) const -> ty::Generic*

Definition at line 34 of file substitution.cpp.

References yume::ty::Generic::name().

◆ mapping() [1/2]

auto yume::Substitutions::mapping ( )
inline

Definition at line 186 of file substitution.hpp.

References all_keys(), and all_values().

Referenced by yume::semantic::Overload::dump(), find_type(), and type_mappings().

◆ mapping() [2/2]

auto yume::Substitutions::mapping ( ) const
inline

Definition at line 187 of file substitution.hpp.

References all_keys(), and all_values().

◆ mapping_ref() [1/2]

auto yume::Substitutions::mapping_ref ( const GenericKey generic) -> GenericValue&
inline

Definition at line 118 of file substitution.hpp.

References mapping_ref_or_null(), and YUME_ASSERT.

Referenced by associate().

◆ mapping_ref() [2/2]

auto yume::Substitutions::mapping_ref ( const GenericKey generic) const -> const GenericValue&
inline

Definition at line 123 of file substitution.hpp.

References mapping_ref_or_null(), and YUME_ASSERT.

◆ mapping_ref_or_null() [1/2]

auto yume::Substitutions::mapping_ref_or_null ( const GenericKey generic) -> nullable<GenericValue*>

Definition at line 7 of file substitution.cpp.

Referenced by find_type(), and mapping_ref().

◆ mapping_ref_or_null() [2/2]

auto yume::Substitutions::mapping_ref_or_null ( const GenericKey generic) const -> nullable<const GenericValue*>

Definition at line 16 of file substitution.cpp.

◆ operator==()

auto yume::Substitutions::operator== ( const Substitutions other) const -> bool
inlinenoexcept

Definition at line 191 of file substitution.hpp.

References all_keys(), and all_values().

◆ size()

auto yume::Substitutions::size ( ) const -> size_t
inline

Definition at line 110 of file substitution.hpp.

◆ type_mappings()

auto yume::Substitutions::type_mappings ( ) const -> std::map<string, ty::Type>

Definition at line 25 of file substitution.cpp.

References mapping().


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