![]() |
Spicy
|
#include <type-info.h>
Public Member Functions | |
Value (const void *ptr, const TypeInfo *ti, const value::Parent &parent) | |
Value (const void *ptr, const TypeInfo *ti, const Value &parent) | |
Value ()=default | |
const void * | pointer () const |
const TypeInfo & | type () const |
operator bool () const | |
Class representing a HILTI value generically through a pair of (1) a raw pointer referring the value's storage, and (2) type information describing how to interpret the raw pointer. An instance may be in an invalid state if there's no underlying value available (e.g., when dereferencing an unset optional
).
Value instances are tied to a Parent
instance. The value's data will remain accessible only as long as the parent stays around. If that goes away, deferencing will throw an error.
|
inline |
Constructor
ptr | raw pointer to storage of the value |
ti | type information describing how to interpret the pointer |
parent | parent controlling life time of the value |
|
inline |
Constructor
ptr | raw pointer to storage of the value |
ti | type information describing how to interpret the pointer |
parent | parent value controlling life time of this value |
|
default |
Default constructor creating a value in invalid state.
|
inline |
Returns true if the instance is referring to a valid value.
|
inline |
Returns a raw pointer to the value's storage.
<tt>InvalidValue</tt> | if the instance is not referring to a valid value. |
|
inline |
Returns the type information associated with the raw pointer.