Yume
Public Member Functions | Protected Member Functions | List of all members
yume::ty::BaseType Class Referenceabstract

Represents a type in the type system. NOTE: that this isn't the class to use for type introspection, for that, Type should be used instead as it is fully qualified. More...

#include <type_base.hpp>

Inheritance diagram for yume::ty::BaseType:
Inheritance graph
[legend]

Public Member Functions

 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
 

Protected Member Functions

 BaseType (Kind kind, string name)
 

Detailed Description

Represents a type in the type system. NOTE: that this isn't the class to use for type introspection, for that, Type should be used instead as it is fully qualified.

All kinds of types inherit from this class. Similar to AST nodes, Types cannot be copied or moved as all special member functions (aside from the destructor) are deleted.

There will always be one instance of a Type object for a specific type. This means that comparing if two types are the same type is simply a pointer equality check.

The single instance of most types is located in TypeHolder, however "qualified" types are instead stored in instances of Type. A "qualified" type is, for example, mut. These qualifiers do not stack. Getting the "mut" reference to a mutable reference should be itself.

Also, pointer-like types are also not held in TypeHolder, and are instead stored in the m_known_... fields of their pointee type.

Definition at line 42 of file type_base.hpp.

Constructor & Destructor Documentation

◆ BaseType() [1/3]

yume::ty::BaseType::BaseType ( const BaseType )
deletenoexcept

◆ BaseType() [2/3]

yume::ty::BaseType::BaseType ( BaseType &&  )
deletenoexcept

◆ ~BaseType()

virtual yume::ty::BaseType::~BaseType ( )
virtualdefault

◆ BaseType() [3/3]

yume::ty::BaseType::BaseType ( Kind  kind,
string  name 
)
inlineprotected

Definition at line 62 of file type_base.hpp.

Member Function Documentation

◆ base_name()

auto yume::ty::BaseType::base_name ( ) const -> string
inline

◆ kind()

auto yume::ty::BaseType::kind ( ) const -> Kind
inline

Definition at line 57 of file type_base.hpp.

Referenced by yume::ty::Type::compatibility().

◆ name()

virtual auto yume::ty::BaseType::name ( ) const -> string
pure virtual

◆ operator=() [1/2]

auto yume::ty::BaseType::operator= ( BaseType &&  ) -> BaseType &=delete
deletenoexcept

◆ operator=() [2/2]

auto yume::ty::BaseType::operator= ( const BaseType ) -> BaseType &=delete
deletenoexcept

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