Spicy
Public Member Functions | Static Public Member Functions | List of all members
spicy::rt::ParsedUnit Class Reference

#include <parsed-unit.h>

Inheritance diagram for spicy::rt::ParsedUnit:
hilti::rt::type_info::value::Parent

Public Member Functions

template<typename T >
const T & get () const
 
hilti::rt::type_info::Value value () const
 
void reset ()
 
- Public Member Functions inherited from hilti::rt::type_info::value::Parent
template<typename T >
 Parent (const StrongReference< T > &value)
 
 Parent ()
 
void tie (hilti::rt::StrongReferenceGeneric value)
 

Static Public Member Functions

template<typename T >
static void initialize (ParsedUnit &u, const hilti::rt::ValueReference< T > &t, const hilti::rt::TypeInfo *ti)
 

Detailed Description

Type-erased wrapper around parsed unit instances.

Initially, this will be unbound, i.e., not refer to any particular instance. initialize() then binds it to an instance and have ParsedUnit hold a strong reference to it.

Member Function Documentation

◆ get()

template<typename T >
const T& spicy::rt::ParsedUnit::get ( ) const
inline

Returns typed access to the contained instance.

◆ initialize()

template<typename T >
static void spicy::rt::ParsedUnit::initialize ( ParsedUnit u,
const hilti::rt::ValueReference< T > &  t,
const hilti::rt::TypeInfo ti 
)
inlinestatic

Initializes the wrapper with a particular parse unit instance. The ParsedUnit will hold a strong reference to the instance until released.

Parameters
utype-erased wrapper to initialize
treference to instance to initialize u with
tipointer to valid type information for T

◆ reset()

void spicy::rt::ParsedUnit::reset ( )
inline

Releases any contained instance.

◆ value()

hilti::rt::type_info::Value spicy::rt::ParsedUnit::value ( ) const
inline

Returns the instance and its type in a value representation suitable to use with the type-info API for iteration over the fields.


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