![]() |
Spicy
|
#include <unit-context.h>
Public Member Functions | |
| template<typename T > | |
| UnitContext (hilti::rt::StrongReference< T > obj, const hilti::rt::TypeInfo *ti) | |
| template<typename Context > | |
| hilti::rt::StrongReference< Context > | as (const hilti::rt::TypeInfo *ti) const |
| UnitContext (const UnitContext &)=default | |
| UnitContext (UnitContext &&)=default | |
| UnitContext & | operator= (const UnitContext &)=default |
| UnitContext & | operator= (UnitContext &&)=default |
Exception thrown on attempts to use a context not matching what the unit expects. Type-erased wrapper around an instance of a parsing unit's context type.
This stores a reference to the instance, along with shallow copy semantics. That means that units using copies of a particular instance of this class will all share the same context.
|
inline |
| T | type of the a unit's context. |
| obj | reference to a concrete context's instance |
| ti | type information matching obj |
|
inline |
Returns the stored context instance, typed correctly.
| Context | type of the context stored. |
| obj | ti type information matching Context |