![]() |
Spicy
|
#include <type-info.h>
Public Types | |
using | Accessor = const void *(*)(const Value &v) |
Public Member Functions | |
Field (const char *name, const TypeInfo *type, std::ptrdiff_t offset, bool internal, Accessor accessor=accessor_default) | |
bool | isInternal () const |
Static Public Member Functions | |
static const void * | accessor_default (const Value &v) |
template<typename T > | |
static Accessor | accessor_optional () |
Public Attributes | |
const std::string | name |
const TypeInfo * | type |
Friends | |
class | type_info::Struct |
Auxiliary type information for type struct
describing one field.
using hilti::rt::type_info::struct_::Field::Accessor = const void* (*)(const Value& v) |
Type of a function that, given a field value, returns a pointer to the contained value.
|
inline |
Constructor.
name | ID of the field |
type | type of the field |
offset | offset of the field in number bytes inside the struct |
accessor | function returning a pointer to a fields value |
|
inlinestatic |
Default accessor function suitable for non-optional fields.
|
inlinestatic |
Alternative accessor function for &optional
fields.
const std::string hilti::rt::type_info::struct_::Field::name |
ID of the field
const TypeInfo* hilti::rt::type_info::struct_::Field::type |
< type of the field