Spicy
Public Types | Public Member Functions | List of all members
hilti::type::Computed Class Reference

#include <computed.h>

Inheritance diagram for hilti::type::Computed:
hilti::TypeBase hilti::type::trait::hasDynamicType hilti::type::trait::isParameterized hilti::type::trait::isViewable hilti::type::trait::isDereferencable hilti::type::trait::isIterable hilti::NodeBase hilti::trait::isType hilti::trait::isNode hilti::trait::isNode

Public Types

using Callback = std::function< Type(Node &)>
 
using Callback2 = std::function< Type(Node &, Node &)>
 

Public Member Functions

 Computed (NodeRef r, Meta m=Meta())
 
 Computed (NodeRef r, Callback cb, Meta m=Meta())
 
 Computed (Expression e, Meta m=Meta())
 
 Computed (NodeRef r1, NodeRef r2, Callback2 cb, Meta m=Meta())
 
 Computed (Expression e, Callback cb, Meta m=Meta())
 
 Computed (Type t, Meta m=Meta())
 
 Computed (Type t, Callback cb, Meta m=Meta())
 
 Computed (Type t, Node n, Callback2 cb2, Meta m=Meta())
 
Type type () const
 
bool operator== (const Computed &other) const
 
bool isEqual (const Type &other) const
 
Type effectiveType () const
 
std::vector< NodetypeParameters () const
 
bool isWildcard () const
 
Type iteratorType (bool const_) const
 
Type viewType () const
 
Type dereferencedType () const
 
Type elementType () const
 
auto properties () const
 
- Public Member Functions inherited from hilti::TypeBase
bool hasFlag (type::Flag f) const
 
type::Flags flags () const
 
bool _isConstant () const
 
std::optional< IDtypeID () const
 
std::optional< IDcxxID () const
 
const type::detail::State_state () const
 
type::detail::State_state ()
 
- Public Member Functions inherited from hilti::NodeBase
 NodeBase (Meta meta)
 
 NodeBase (std::vector< Node > childs, Meta meta)
 
template<typename T >
const T & child (int i) const
 
template<typename T >
void assertChildIsA (int i)
 
template<typename T >
std::vector< T > childs (int begin, int end) const
 
template<typename T >
std::vector< T > childsOfType () const
 
template<typename T >
auto nodesOfType () const
 
template<typename T >
auto nodesOfType ()
 
void addChild (Node n)
 
auto & childs () const
 
auto & childs ()
 
auto & meta () const
 
void setMeta (Meta m)
 
const NodeReforiginalNode () const
 
void setOriginalNode (const NodeRef &n)
 
void clearCache ()
 

Detailed Description

AST node for a type computed dynamically from another node that's potentially not resolved at first yet. This works either through a callback that executes at time the type is accessed, with access to the original node; or through an expression which's type at the time of access determined the result.

Note
This class gets a full set of traits, so that it can forward all method calls to the resulting type.

Member Function Documentation

◆ effectiveType()

Type hilti::type::Computed::effectiveType ( ) const
inline

Implements the Type interface.

◆ isEqual()

bool hilti::type::Computed::isEqual ( const Type &  other) const
inline

Implements the Type interface.

◆ properties()

auto hilti::type::Computed::properties ( ) const
inline

Implements the Node interface.


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