Yume
Public Member Functions | List of all members
yume::ty::Struct Class Referencefinal

An user-defined struct type with associated fields. More...

#include <type.hpp>

Inheritance diagram for yume::ty::Struct:
Inheritance graph
[legend]
Collaboration diagram for yume::ty::Struct:
Collaboration graph
[legend]

Public Member Functions

 Struct (string name, vector< ast::TypeName * > fields, nonnull< yume::Struct * > decl, nullable< const Substitutions * > subs)
 
auto fields () const -> const auto &
 
auto fields () -> auto &
 
auto subs () const -> const auto *
 
auto subs () -> auto *
 
auto decl () const -> nonnull< yume::Struct * >
 
auto is_interface () const -> bool
 
auto implements () const -> const ast::OptionalType &
 
auto name () const -> string override
 
auto memo () const -> auto *
 
void memo (Compiler &, llvm::Type *memo) const
 
auto get_or_create_instantiation (Substitutions sub) const -> const Struct &
 
- Public Member Functions inherited from yume::ty::BaseType
 BaseType (const BaseType &) noexcept=delete
 
 BaseType (BaseType &&) noexcept=delete
 
auto operator= (const BaseType &) noexcept -> BaseType &=delete
 
auto operator= (BaseType &&) noexcept -> BaseType &=delete
 
virtual ~BaseType ()=default
 
auto kind () const -> Kind
 
auto base_name () const -> string
 
virtual auto name () const -> string=0
 

Additional Inherited Members

- Protected Member Functions inherited from yume::ty::BaseType
 BaseType (Kind kind, string name)
 

Detailed Description

An user-defined struct type with associated fields.

Definition at line 78 of file type.hpp.

Constructor & Destructor Documentation

◆ Struct()

yume::ty::Struct::Struct ( string  name,
vector< ast::TypeName * >  fields,
nonnull< yume::Struct * >  decl,
nullable< const Substitutions * >  subs 
)
inline

Definition at line 109 of file type.hpp.

Member Function Documentation

◆ decl()

auto yume::ty::Struct::decl ( ) const -> nonnull<yume::Struct*>
inline

Definition at line 115 of file type.hpp.

Referenced by yume::Compiler::expression().

◆ fields() [1/2]

auto yume::ty::Struct::fields ( ) -> auto&
inline

Definition at line 112 of file type.hpp.

◆ fields() [2/2]

auto yume::ty::Struct::fields ( ) const -> const auto&
inline

Definition at line 111 of file type.hpp.

◆ get_or_create_instantiation()

auto yume::ty::Struct::get_or_create_instantiation ( Substitutions  sub) const -> const Struct&

Definition at line 306 of file type.cpp.

References get_or_create_instantiation().

Referenced by get_or_create_instantiation().

◆ implements()

auto yume::ty::Struct::implements ( ) const -> const ast::OptionalType&

Definition at line 379 of file type.cpp.

◆ is_interface()

auto yume::ty::Struct::is_interface ( ) const -> bool

Definition at line 377 of file type.cpp.

Referenced by yume::Compiler::expression().

◆ memo() [1/2]

auto yume::ty::Struct::memo ( ) const -> auto*
inline

Definition at line 120 of file type.hpp.

◆ memo() [2/2]

void yume::ty::Struct::memo ( Compiler ,
llvm::Type *  memo 
) const
inline

Definition at line 121 of file type.hpp.

References memo().

Referenced by memo().

◆ name()

auto yume::ty::Struct::name ( ) const -> string
overridevirtual

Implements yume::ty::BaseType.

Definition at line 462 of file type.cpp.

References yume::ty::BaseType::base_name().

◆ subs() [1/2]

auto yume::ty::Struct::subs ( ) -> auto*
inline

Definition at line 114 of file type.hpp.

◆ subs() [2/2]

auto yume::ty::Struct::subs ( ) const -> const auto*
inline

Definition at line 113 of file type.hpp.


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